getdata-commits Mailing List for GetData (Page 15)
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: <syn...@us...> - 2011-05-03 20:08:50
|
Revision: 585 http://getdata.svn.sourceforge.net/getdata/?rev=585&view=rev Author: syntheticpp Date: 2011-05-03 20:08:44 +0000 (Tue, 03 May 2011) Log Message: ----------- C89 fix Modified Paths: -------------- trunk/getdata/src/errors.c Modified: trunk/getdata/src/errors.c =================================================================== --- trunk/getdata/src/errors.c 2011-05-03 19:47:07 UTC (rev 584) +++ trunk/getdata/src/errors.c 2011-05-03 20:08:44 UTC (rev 585) @@ -331,8 +331,10 @@ int gd_error_count(DIRFILE *D) { + int count; + dtrace("%p", D); - int count = D->n_error; + count = D->n_error; D->n_error = 0; dreturn("%i", count); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-05-03 19:47:14
|
Revision: 584 http://getdata.svn.sourceforge.net/getdata/?rev=584&view=rev Author: ketiltrout Date: 2011-05-03 19:47:07 +0000 (Tue, 03 May 2011) Log Message: ----------- Fix Caltech links. Modified Paths: -------------- trunk/html/index.html Modified: trunk/html/index.html =================================================================== --- trunk/html/index.html 2011-04-29 00:36:09 UTC (rev 583) +++ trunk/html/index.html 2011-05-03 19:47:07 UTC (rev 584) @@ -114,15 +114,15 @@ the C API, <a href="bindings.html">bindings</a> are provided for Fortran, C++, Python, and IDL. <P>GetData was originally written for the <a - href="http://www.astro.caltech.edu/~lgg/boomerang_front.htm" + href="http://www.astro.caltech.edu/~lgg/boomerang/boomerang_front.htm" >BOOMERanG</a> and <a href="http://blastexperiment.info/">BLAST</a> experiments as a data format suitable for use for both quick-look and data reduction. It is now used by many other cosmological and astrophysical experiments including <a href="http://www.physics.princeton.edu/act/" >ACT</a>, <i><a href="http://www.rssd.esa.int/index.php?project=Planck" >Planck</a></i>, <a - href="http://www.astro.caltech.edu/~lgg/spider_front.htm">Spider</a>, - as well as other projects. + href="http://www.astro.caltech.edu/~lgg/spider/spider_front.htm" + >Spider</a>, as well as other projects. GetData began life as one of the native data formats supported by the <a href="http://kst.kde.org/">kst</a> plotting program, which was also written to provide quick-look capability to BOOMERanG and BLAST. Because This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-29 00:36:16
|
Revision: 583 http://getdata.svn.sourceforge.net/getdata/?rev=583&view=rev Author: ketiltrout Date: 2011-04-29 00:36:09 +0000 (Fri, 29 Apr 2011) Log Message: ----------- Debuggery. Modified Paths: -------------- trunk/getdata/bindings/perl/GetData.xs trunk/getdata/src/getdata.c Modified: trunk/getdata/bindings/perl/GetData.xs =================================================================== --- trunk/getdata/bindings/perl/GetData.xs 2011-04-21 16:14:09 UTC (rev 582) +++ trunk/getdata/bindings/perl/GetData.xs 2011-04-29 00:36:09 UTC (rev 583) @@ -1659,6 +1659,7 @@ CLEANUP: if (din.arg_type != GDP_DATA_IN_PACK) safefree(din.data_in); + dreturn("%i", RETVAL); int add_carray(dirfile, field_code, const_type, fragment_index, d, ...) Modified: trunk/getdata/src/getdata.c =================================================================== --- trunk/getdata/src/getdata.c 2011-04-21 16:14:09 UTC (rev 582) +++ trunk/getdata/src/getdata.c 2011-04-29 00:36:09 UTC (rev 583) @@ -158,6 +158,8 @@ _GD_SetError(D, GD_E_BAD_TYPE, type, NULL, 0, NULL); break; } + + dreturnvoid(); } /* _GD_FillFileFrame: fill dataout with frame indices This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-21 16:14:15
|
Revision: 582 http://getdata.svn.sourceforge.net/getdata/?rev=582&view=rev Author: ketiltrout Date: 2011-04-21 16:14:09 +0000 (Thu, 21 Apr 2011) Log Message: ----------- Typo. Modified Paths: -------------- trunk/getdata/bindings/f77/fgetdata.c Modified: trunk/getdata/bindings/f77/fgetdata.c =================================================================== --- trunk/getdata/bindings/f77/fgetdata.c 2011-04-20 22:42:47 UTC (rev 581) +++ trunk/getdata/bindings/f77/fgetdata.c 2011-04-21 16:14:09 UTC (rev 582) @@ -386,9 +386,9 @@ } /* gd_error_count wrapper */ -void F77_FUNC(gderor, GDECNT) (int* error_count, const int* dirfile) +void F77_FUNC(gdecnt, GDECNT) (int* error_count, const int* dirfile) { - dtrace("%p, %i", error, *dirfile); + dtrace("%p, %i", error_count, *dirfile); *error_count = gd_error_count(_GDF_GetDirfile(*dirfile)); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-20 22:42:54
|
Revision: 581 http://getdata.svn.sourceforge.net/getdata/?rev=581&view=rev Author: ketiltrout Date: 2011-04-20 22:42:47 +0000 (Wed, 20 Apr 2011) Log Message: ----------- gd_error_count bindings. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/TODO trunk/getdata/bindings/cxx/dirfile.cpp trunk/getdata/bindings/cxx/getdata/dirfile.h trunk/getdata/bindings/f77/fgetdata.c trunk/getdata/bindings/f77/getdata.f.in trunk/getdata/bindings/f77/getdata.f90.in trunk/getdata/bindings/idl/getdata.c trunk/getdata/bindings/make_parameters.c trunk/getdata/bindings/perl/GetData.pm.in trunk/getdata/bindings/perl/GetData.xs trunk/getdata/bindings/perl/Makefile.am trunk/getdata/bindings/perl/simple_funcs.xsin trunk/getdata/bindings/python/pydirfile.c trunk/getdata/doc/README.cxx trunk/getdata/doc/README.f77 trunk/getdata/doc/README.f95 trunk/getdata/doc/README.idl trunk/getdata/man/gd_error_count.3 Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/ChangeLog 2011-04-20 22:42:47 UTC (rev 581) @@ -1,3 +1,18 @@ +2011-04-21 D. V. Wiebe <ge...@ke...> svn:581 + * bindings/python/pydirfile.c (gdpy_dirfile_geterrorcount): Added. + * bindings/cxx/dirfile.cpp (Dirfile::ErrorCount): Added. + * bindings/f77/fgetdata.c (GDECNT): Added. + * bindings/f77/fgetdata.f90.in (fgd_error_count): Added. + * bindings/idl/getdata.c (gdidl_error_count): Added. + + * bindings/perl/GetData.xs (gdp_to_entry): Fix initialisation of n for + LINCOM and POLYNOM. + + * bindings/perl/GetData.pm.in: add constants and functions export tags. + + * bindings/make_parameters.c (Perl): Don't insert unnecessary newlines. + * bindings/perl/Makefile.am: Use perl to generate funclist.sed. + 2011-04-20 D. V. Wiebe <ge...@ke...> svn:580 * test/error_num.c: Added. * src/errors.c (gd_error_count): Added. Modified: trunk/getdata/TODO =================================================================== --- trunk/getdata/TODO 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/TODO 2011-04-20 22:42:47 UTC (rev 581) @@ -9,4 +9,3 @@ * aliasing [MT] * Fix REFERENCE spam [MT] * Fragment encapsulation [MT/CBN] -* gd_error_count bindings Modified: trunk/getdata/bindings/cxx/dirfile.cpp =================================================================== --- trunk/getdata/bindings/cxx/dirfile.cpp 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/cxx/dirfile.cpp 2011-04-20 22:42:47 UTC (rev 581) @@ -139,6 +139,11 @@ return gd_error(D); } +int Dirfile::ErrorCount() +{ + return gd_error_count(D); +} + const char *Dirfile::ErrorString(size_t __gd_unused n) { return ErrorString(); Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h =================================================================== --- trunk/getdata/bindings/cxx/getdata/dirfile.h 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2011-04-20 22:42:47 UTC (rev 581) @@ -111,6 +111,8 @@ int Error() const; + int ErrorCount(); + const char *ErrorString(); const char *ErrorString(size_t n) gd_deprecated; Modified: trunk/getdata/bindings/f77/fgetdata.c =================================================================== --- trunk/getdata/bindings/f77/fgetdata.c 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/f77/fgetdata.c 2011-04-20 22:42:47 UTC (rev 581) @@ -385,6 +385,16 @@ dreturn("%i", *error); } +/* gd_error_count wrapper */ +void F77_FUNC(gderor, GDECNT) (int* error_count, const int* dirfile) +{ + dtrace("%p, %i", error, *dirfile); + + *error_count = gd_error_count(_GDF_GetDirfile(*dirfile)); + + dreturn("%i", *error_count); +} + /* gd_error_string wrapper */ void F77_FUNC(gdestr, GDESTR) (const int* dirfile, char* buffer, const int* len) { Modified: trunk/getdata/bindings/f77/getdata.f.in =================================================================== --- trunk/getdata/bindings/f77/getdata.f.in 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/f77/getdata.f.in 2011-04-20 22:42:47 UTC (rev 581) @@ -115,6 +115,8 @@ EXTERNAL GDDELE C Corresponding to gd_discard(3) EXTERNAL GDDSCD +C Corresponding to gd_error_count(3) + EXTERNAL GDECNT C Corresponding to gd_entry_type(3) EXTERNAL GDENTY C Corresponding to gd_error(3) Modified: trunk/getdata/bindings/f77/getdata.f90.in =================================================================== --- trunk/getdata/bindings/f77/getdata.f90.in 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/f77/getdata.f90.in 2011-04-20 22:42:47 UTC (rev 581) @@ -769,6 +769,14 @@ call gderor(fgd_error, dirfile) end function +function fgd_error_count (dirfile) + integer :: fgd_error_count + integer, intent(in) :: dirfile + + ! call f77 library + call gdecnt(fgd_error_count, dirfile) +end function + subroutine fgd_error_string (dirfile, buffer, len) integer, intent(in) :: dirfile, len character (len=*), intent(out) :: buffer Modified: trunk/getdata/bindings/idl/getdata.c =================================================================== --- trunk/getdata/bindings/idl/getdata.c 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/idl/getdata.c 2011-04-20 22:42:47 UTC (rev 581) @@ -3803,6 +3803,18 @@ return r; } +/* @@DLM: F gdidl_error_count GD_ERROR_COUNT 1 1 */ +IDL_VPTR gdidl_error_count(int argc, IDL_VPTR argv[], char *argk) +{ + dtraceidl(); + + int err = gd_error_count(gdidl_get_dirfile(IDL_LongScalar(argv[0]))); + + IDL_VPTR r = IDL_GettmpInt(err); + dreturn("%p", r); + return r; +} + /* @@DLM: F gdidl_error_string GD_ERROR_STRING 1 1 */ IDL_VPTR gdidl_error_string(int argc, IDL_VPTR argv[], char *argk) { Modified: trunk/getdata/bindings/make_parameters.c =================================================================== --- trunk/getdata/bindings/make_parameters.c 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/make_parameters.c 2011-04-20 22:42:47 UTC (rev 581) @@ -362,7 +362,7 @@ printf("s/@PARAMLIST@/"); for (i = 0; constant_list[i].lname != NULL; ++i) - printf("%s\\\n", constant_list[i].sname, constant_list[i].value); + printf("%s ", constant_list[i].sname, constant_list[i].value); printf("/\n"); } Modified: trunk/getdata/bindings/perl/GetData.pm.in =================================================================== --- trunk/getdata/bindings/perl/GetData.pm.in 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/perl/GetData.pm.in 2011-04-20 22:42:47 UTC (rev 581) @@ -29,10 +29,8 @@ require Math::Complex; our @ISA = qw(Exporter); -our %EXPORT_TAGS = ( 'all' => [ qw(VERSION - @FUNCLIST@ - @PARAMLIST@ - ) ] ); +our %EXPORT_TAGS = ( 'all' => [ qw(VERSION @FUNCLIST@ @PARAMLIST@) ], +'constants' => [ qw(VERSION @PARAMLIST@) ], 'functions' => [ qw(@FUNCLIST@) ]); our @EXPORT_OK = ( @{$EXPORT_TAGS{'all'}} ); our @EXPORT = qw(); Modified: trunk/getdata/bindings/perl/GetData.xs =================================================================== --- trunk/getdata/bindings/perl/GetData.xs 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/perl/GetData.xs 2011-04-20 22:42:47 UTC (rev 581) @@ -276,7 +276,7 @@ break; case GD_LINCOM_ENTRY: GDP_EHASH_FETCH_IV("n_fields", n_fields, int); - n = (E->n_fields > GD_MAX_LINCOM) ? GD_MAX_LINCOM : n; + n = (E->n_fields > GD_MAX_LINCOM) ? GD_MAX_LINCOM : E->n_fields; gdp_fetch_in_fields(E->in_fields, sv, n, pkg, func); E->comp_scal = 1; gdp_fetch_cmp_list(E->cm, (HV*)sv, "cm", n, pkg, func); @@ -299,7 +299,7 @@ case GD_POLYNOM_ENTRY: GDP_EHASH_FETCH_PV("in_field", in_fields[0]); GDP_EHASH_FETCH_IV("poly_ord", poly_ord, int); - n = (E->poly_ord > GD_MAX_POLYORD) ? GD_MAX_POLYORD : n; + n = (E->poly_ord > GD_MAX_POLYORD) ? GD_MAX_POLYORD : E->poly_ord; E->comp_scal = 1; gdp_fetch_cmp_list(E->ca, (HV*)sv, "ca", n, pkg, func); gdp_fetch_scalars(E, (HV*)sv, (1 << (n + 1)) - 1, pkg, func); Modified: trunk/getdata/bindings/perl/Makefile.am =================================================================== --- trunk/getdata/bindings/perl/Makefile.am 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/perl/Makefile.am 2011-04-20 22:42:47 UTC (rev 581) @@ -47,10 +47,9 @@ $(PERL) simple_funcs.pl $< > $@ funclist.sed: GetData.c - echo $(ECHO_N) "s/@FUNCLIST@/" > $@ - $(AWK) '/^XS\(XS_GetData_.*\);/ {print $$1}' $< | \ - $(SED) -e 's/.*XS_GetData_\(.*\));/\1\\/' >> $@ - echo / >> $@ + $(PERL) -ne 'BEGIN { print "s/\@FUNCLIST@/" }' \ + -e 'print "$$1 " if /^XS\(XS_GetData_([a-z].*)\);/;' \ + -e 'END { print "/\n" }' $< > $@ make_parameters.sed: ../make_parameters ../../src/getdata.h ../make_parameters P > $@ Modified: trunk/getdata/bindings/perl/simple_funcs.xsin =================================================================== --- trunk/getdata/bindings/perl/simple_funcs.xsin 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/perl/simple_funcs.xsin 2011-04-20 22:42:47 UTC (rev 581) @@ -117,3 +117,4 @@ off64_t nframes64(DIRFILE *dirfile) off64_t bof64(DIRFILE *dirfile, const char* field_code) off64_t eof64(DIRFILE *dirfile, const char* field_code) +int error_count(DIRFILE *dirfile) Modified: trunk/getdata/bindings/python/pydirfile.c =================================================================== --- trunk/getdata/bindings/python/pydirfile.c 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/bindings/python/pydirfile.c 2011-04-20 22:42:47 UTC (rev 581) @@ -728,6 +728,17 @@ return error; } +static PyObject* gdpy_dirfile_geterrorcount(struct gdpy_dirfile_t* self, + void* closure) +{ + dtrace("%p, %p", self, closure); + + PyObject* count = PyInt_FromLong(gd_error_count(self->D)); + + dreturn("%p", count); + return count; +} + static PyObject* gdpy_dirfile_getfragment(struct gdpy_dirfile_t* self, void* args, void* keys) { @@ -2067,6 +2078,12 @@ "errors, it is typically not necessary to check this value; use a\n" "try/except statement instead. See gd_error(3).", NULL }, + { "error_count", (getter)gdpy_dirfile_geterrorcount, NULL, + "The number of errors encountered by the GetData library for this\n" + /* -----------------------------------------------------------------| */ + "dirfile since the last time this member was accessed. Note:\n" + "accessing this member, resets it to zero. See gd_error_count(3).", + NULL }, { "error_string", (getter)gdpy_dirfile_geterrorstring, NULL, "A human-readable description of the last error encountered by the\n" "GetData library for this dirfile. See gd_error_string(3).", @@ -2214,7 +2231,6 @@ "field. If NumPy support is present in pygetdata, and 'as_list' is\n" "not given or zero, the values will be returned in NumPy arrays;\n" "otherwise, the values will be returned as lists.\n\n" - /* -----------------------------------------------------------------| */ "The 'return_type' parameter indicates the desired type of the values\n" "returned, and should be (typically) one of: pygetdata.INT,\n" "pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n" Modified: trunk/getdata/doc/README.cxx =================================================================== --- trunk/getdata/doc/README.cxx 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/doc/README.cxx 2011-04-20 22:42:47 UTC (rev 581) @@ -47,9 +47,15 @@ * int Dirfile::Error() - The Error method provides access to the error member of the underlying - DIRFILE* object. + The Error method calls gd_error(3) to return the error status of the last + GetData library call on this Dirfile object. +* int Dirfile::ErrorCount() + + The ErrorCount method calls gd_error_count(3) to return the number of errors + encountered by the GetData library on this Dirfile object since this method + was last called (or, the first time, since the object was created).. + * const char *Dirfile::ErrorString() * const char *Dirfile::ErrorString(size_t len) Modified: trunk/getdata/doc/README.f77 =================================================================== --- trunk/getdata/doc/README.f77 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/doc/README.f77 2011-04-20 22:42:47 UTC (rev 581) @@ -466,6 +466,18 @@ This wraps gd_nframes(3). It takes the dirfile unit number as input and returns the number of frames in the dirfile in nframes. +* GDECNT(error_count, dirfile_unit) + + Output: + INTEGER error_count + Input: + INTEGER dirfile_unit + + This subroutine wraps gd_error_count(3). It takes the dirfile unit number as + input and returns the number of errors encountered by GetData since the last + call to this subroutine (or since the dirfile was first opened) in + error_count. + * GDEROR(error, dirfile_unit) Output: @@ -473,9 +485,9 @@ Input: INTEGER dirfile_unit - This subroutine takes a dirfile unit as input and returns the DIRFILE.error - value associated with it in error. The value of error will equal one of the - error codes defined in getdata.f. + This subroutine wraps gd_error(3). It takes the dirfile unit number as input + and returns the error value arising from the last library call in error. The + value of error will equal one of the error codes defined in getdata.f. * GDESTR(dirfile_unit, buffer, buffer_len) Modified: trunk/getdata/doc/README.f95 =================================================================== --- trunk/getdata/doc/README.f95 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/doc/README.f95 2011-04-20 22:42:47 UTC (rev 581) @@ -107,6 +107,12 @@ integer, intent(in) :: dirfile character (len=*), intent(in) :: field_code +* integer function fgd_error (dirfile_unit) + integer, intent(in) :: dirfile_unit + +* integer function fgd_error_count (dirfile_unit) + integer, intent(in) :: dirfile_unit + * integer function fgd_error_string (dirfile, buffer, len) integer, intent(in) :: dirfile, len character (len=<len>), intent(out) :: buffer @@ -656,11 +662,6 @@ integer, intent(inout) :: field_len character (len=*), intent(in) :: parent -* integer function fgd_error (dirfile_unit) - integer, intent(in) :: dirfile_unit - - This returns the DIRFILE error associated with the supplied dirfile unit. - * integer function fgd_entry (dirfile_unit, field_code, ent) integer, intent(in) :: dirfile_unit character (len=*), intent(in) :: field_code Modified: trunk/getdata/doc/README.idl =================================================================== --- trunk/getdata/doc/README.idl 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/doc/README.idl 2011-04-20 22:42:47 UTC (rev 581) @@ -81,19 +81,20 @@ IDL supports all GetData data types with the exception of INT8. Attempting to return data as INT8 will result in an error. -Except for the functions GETDATA_CONSTANTS, GD_ERROR, GD_ERROR_STRING, and -GD_INVALID_DIRFILE, all IDL GetData functions and procedures may take two -optional keyword parameters which deal with error reporting: +Except for the functions GETDATA_CONSTANTS, GD_ERROR, GD_ERROR_COUNT, +GD_ERROR_STRING, and GD_INVALID_DIRFILE, all IDL GetData functions and +procedures may take two optional keyword parameters which deal with error +reporting: ERROR: a variable in which the dirfile error number resulting from this - call will be stored. It will be the !GD.E_* error codes - corresponding to the C API error code. On success this will be - !GD.E_OK (= 0). If this parameter is not specified, the dirfile - error can still be retrieved by calling GD_ERROR() after this call. + call will be stored. It will be the !GD.E_* error code corresponding + to the C API error code. On success this will be !GD.E_OK (= 0). If + this parameter is not specified, the dirfile error can still be + retrieved by calling GD_ERROR() after this call. ESTRING: a variable in which the string representation of the error resulting from this call will be stored. If this parameter is not specified, the the dirfile error string can still be retrieved by calling - GD_ERROR_STRING(). + GD_ERROR_STRING() after the call. For brevity, these keyword parameters are omitted from the subroutine prototypes given below. @@ -555,6 +556,13 @@ This function does not take the normal ERROR and ESTRING keyword parameters. See gd_error(3). +FUNCTION GD_ERROR_COUNT(dirfile_unit) + + This function returns the number of errors encountered by the GetData library + on the specified dirfile since this function was last called (or since the + dirfile was opened, if this is the first call to this function). See + gd_error_count(3). + FUNCTION GD_ERROR_STRING(dirfile_unit) This function returns a human readable string describing the error status of Modified: trunk/getdata/man/gd_error_count.3 =================================================================== --- trunk/getdata/man/gd_error_count.3 2011-04-19 22:51:58 UTC (rev 580) +++ trunk/getdata/man/gd_error_count.3 2011-04-20 22:42:47 UTC (rev 581) @@ -13,7 +13,7 @@ .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" -.TH gd_error_count 3 "19 April 2011" "Version 0.8.0" "GETDATA" +.TH gd_error_count 3 "20 April 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_error_count \(em report the number of errors encountered by the GetData library @@ -26,22 +26,18 @@ .hy .ad n .SH DESCRIPTION -The -.BR gd_error_count () -function returns the number of errors encountered by the GetData library -on the DIRFILE object -.I dirfile -since this function was last called on -.IR dirfile . The first time .BR gd_error_count () -is called on the supplied -.I dirfile -object, the count is since -.I dirfile -was created. +is called with the DIRFILE object +.IR dirfile , +it returns the number of errors encountered by the GetData library while +operating on the specified DIRFILE object, since the DIRFILE's creation. +Calling this function resets the internal count, so that subsequent calls to +.BR gd_error_count () +return the number of errors encountered only since the previous call to this +function, for the specified DIRFILE. -The +The errors themselves are not cached by the library. The .I last error encountered by the library for .I dirfile This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-19 22:52:06
|
Revision: 580 http://getdata.svn.sourceforge.net/getdata/?rev=580&view=rev Author: ketiltrout Date: 2011-04-19 22:51:58 +0000 (Tue, 19 Apr 2011) Log Message: ----------- gd_error_count(). Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/TODO trunk/getdata/man/Makefile.am trunk/getdata/man/gd_error.3 trunk/getdata/man/gd_error_string.3 trunk/getdata/src/errors.c trunk/getdata/src/getdata.h.in trunk/getdata/src/internal.h trunk/getdata/src/open.c trunk/getdata/test/Makefile.am Added Paths: ----------- trunk/getdata/man/gd_error_count.3 trunk/getdata/test/error_num.c Property Changed: ---------------- trunk/getdata/test/ Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/ChangeLog 2011-04-19 22:51:58 UTC (rev 580) @@ -1,3 +1,8 @@ +2011-04-20 D. V. Wiebe <ge...@ke...> svn:580 + * test/error_num.c: Added. + * src/errors.c (gd_error_count): Added. + * man/gd_error_count.3: Added. + 2011-04-06 D. V. Wiebe <ge...@ke...> svn:574 * test/: Remove the unnecessarily baroque (rococo?) __TEST__ macro. Add rmdirfile() to the top of each test before creating the test Modified: trunk/getdata/TODO =================================================================== --- trunk/getdata/TODO 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/TODO 2011-04-19 22:51:58 UTC (rev 580) @@ -1,12 +1,12 @@ * Locking * Hashed compressed files -* streaming +* Streaming/Appending * linterp table path munging [MH] * Make webpage suck less * Handle RW dirfile on RO data better [JPF] * INCLUDE name munging [RW/MT] * Fix VERSION leakage [MT] -* Error count [MT] * aliasing [MT] * Fix REFERENCE spam [MT] -* Fragment encapsulation [MT] +* Fragment encapsulation [MT/CBN] +* gd_error_count bindings Modified: trunk/getdata/man/Makefile.am =================================================================== --- trunk/getdata/man/Makefile.am 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/man/Makefile.am 2011-04-19 22:51:58 UTC (rev 580) @@ -35,7 +35,7 @@ gd_put_carray_slice.3 gd_get_constant.3 gd_put_constant.3 \ gd_constants.3 gd_dirfile_standards.3 gd_getdata.3 \ gd_putdata.3 gd_delete.3 gd_encoding.3 gd_endianness.3 \ - gd_entry.3 gd_entry_type.3 gd_eof.3 gd_error.3 \ + gd_entry.3 gd_entry_type.3 gd_eof.3 gd_error.3 gd_error_count.3 \ gd_error_string.3 gd_field_list.3 gd_field_list_by_type.3 \ gd_flush.3 gd_fragment_index.3 gd_fragmentname.3 \ gd_framenum_subset.3 gd_frameoffset.3 gd_free_entry_strings.3 \ Modified: trunk/getdata/man/gd_error.3 =================================================================== --- trunk/getdata/man/gd_error.3 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/man/gd_error.3 2011-04-19 22:51:58 UTC (rev 580) @@ -1,6 +1,6 @@ .\" gd_error.3. The gd_error man page. .\" -.\" Copyright (C) 2008, 2010 D. V. Wiebe +.\" Copyright (C) 2008, 2010, 2011 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_error 3 "25 May 2010" "Version 0.7.0" "GETDATA" +.TH gd_error 3 "20 April 2011" "Version 0.8.0" "GETDATA" .SH NAME gd_error \(em report a GetData library error .SH SYNOPSIS @@ -31,11 +31,6 @@ .I dirfile which is set by many GetData library functions. -The -.I dirfile -argument should point to a DIRFILE object previously created by a call to -.BR gd_open (3). - A textual description of the error may be obtained by calling .BR gd_error_string (3). @@ -45,5 +40,5 @@ function always returns the dirfile error corresponding to the error state of the last library call on the supplied DIRFILE object. .SH SEE ALSO -.BR gd_open (3), +.BR gd_error_count (3), .BR gd_error_string (3) Added: trunk/getdata/man/gd_error_count.3 =================================================================== --- trunk/getdata/man/gd_error_count.3 (rev 0) +++ trunk/getdata/man/gd_error_count.3 2011-04-19 22:51:58 UTC (rev 580) @@ -0,0 +1,59 @@ +\" gd_error_count.3. The gd_error_count man page. +.\" +.\" Copyright (C) 2011 D. V. Wiebe +.\" +.\"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.\" +.\" This file is part of the GetData project. +.\" +.\" Permission is granted to copy, distribute and/or modify this document +.\" under the terms of the GNU Free Documentation License, Version 1.2 or +.\" any later version published by the Free Software Foundation; with no +.\" Invariant Sections, with no Front-Cover Texts, and with no Back-Cover +.\" Texts. A copy of the license is included in the `COPYING.DOC' file +.\" as part of this distribution. +.\" +.TH gd_error_count 3 "19 April 2011" "Version 0.8.0" "GETDATA" +.SH NAME +gd_error_count \(em report the number of errors encountered by the GetData +library +.SH SYNOPSIS +.B #inlcude <getdata.h> +.HP +.nh +.ad l +.BI "int gd_error_check(DIRFILE *" dirfile ); +.hy +.ad n +.SH DESCRIPTION +The +.BR gd_error_count () +function returns the number of errors encountered by the GetData library +on the DIRFILE object +.I dirfile +since this function was last called on +.IR dirfile . +The first time +.BR gd_error_count () +is called on the supplied +.I dirfile +object, the count is since +.I dirfile +was created. + +The +.I last +error encountered by the library for +.I dirfile +can be obtained by calling +.BR gd_error (3). + +.SH RETURN VALUE +The +.BR gd_error_count () +function always returns the number of GetData errors encountered since the last +time it was called, or since the dirfile was created. This will be zero, if no +error has occurred over the given time. +.SH SEE ALSO +.BR gd_error (3), +.BR gd_error_string (3) Modified: trunk/getdata/man/gd_error_string.3 =================================================================== --- trunk/getdata/man/gd_error_string.3 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/man/gd_error_string.3 2011-04-19 22:51:58 UTC (rev 580) @@ -1,6 +1,6 @@ .\" gd_error_string.3. The gd_error_string man page. .\" -.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe +.\" Copyright (C) 2008, 2009, 2010, 2011 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_error_string 3 "3 November 2010" "Version 0.7.0" "GETDATA" +.TH gd_error_string 3 "20 April 2011" "Version 0.8.0" "GETDATA" gd_error_string \(em report a GetData library error .SH SYNOPSIS .B #include <getdata.h> @@ -53,11 +53,6 @@ .BR free (3) when it is no longer needed. -The -.I dirfile -argument should point to a DIRFILE object previously created by a call to -.BR gd_open (3). - .SH RETURN VALUE If .I buffer @@ -71,5 +66,5 @@ .I dirfile is unchanged. .SH SEE ALSO -.BR gd_open (3), -.BR gd_error (3) +.BR gd_error (3), +.BR gd_error_string (3) Modified: trunk/getdata/src/errors.c =================================================================== --- trunk/getdata/src/errors.c 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/src/errors.c 2011-04-19 22:51:58 UTC (rev 580) @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 C. Barth Netterfield - * Copyright (C) 2005-2010 D. V. Wiebe + * Copyright (C) 2005-2011 D. V. Wiebe * *************************************************************************** * @@ -200,6 +200,8 @@ line, token); D->error = error; + if (error != GD_E_OK) + D->n_error++; D->suberror = suberror; D->error_line = line; if (format_file != NULL) { @@ -326,5 +328,16 @@ dreturn("\"%s\"", buffer); return buffer; } + +int gd_error_count(DIRFILE *D) +{ + dtrace("%p", D); + int count = D->n_error; + D->n_error = 0; + + dreturn("%i", count); + + return count; +} /* vim: ts=2 sw=2 et tw=80 */ Modified: trunk/getdata/src/getdata.h.in =================================================================== --- trunk/getdata/src/getdata.h.in 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/src/getdata.h.in 2011-04-19 22:51:58 UTC (rev 580) @@ -575,6 +575,8 @@ extern int gd_error(const DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); +extern int gd_error_count(DIRFILE *dirfile) gd_nothrow gd_nonnull ((1)); + extern char *gd_error_string(const DIRFILE *dirfile, char *buffer, size_t buflen) gd_nothrow gd_nonnull ((1)); Modified: trunk/getdata/src/internal.h =================================================================== --- trunk/getdata/src/internal.h 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/src/internal.h 2011-04-19 22:51:58 UTC (rev 580) @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 C. Barth Netterfield - * Copyright (C) 2005-2010 D. V. Wiebe + * Copyright (C) 2005-2011 D. V. Wiebe * *************************************************************************** * @@ -573,6 +573,7 @@ unsigned long int flags; uint64_t av; int standards; + int n_error; /* field counts */ unsigned int n_entries; Modified: trunk/getdata/src/open.c =================================================================== --- trunk/getdata/src/open.c 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/src/open.c 2011-04-19 22:51:58 UTC (rev 580) @@ -240,8 +240,6 @@ if (flags & GD_PERMISSIVE && flags & GD_PEDANTIC) flags &= ~GD_PERMISSIVE; - D->error_string = NULL; - D->error_file = NULL; D->name = strdup(filedir); D->flags = (flags | GD_INVALID) & ~GD_IGNORE_REFS; D->sehandler = sehandler; Property changes on: trunk/getdata/test ___________________________________________________________________ Modified: svn:ignore - Makefile Makefile.in *.o *.odirfile *.swp *.exe .deps .libs convert_uint8_int8 convert_uint8_uint16 convert_uint8_int16 convert_uint8_uint32 convert_uint8_int32 convert_uint8_float32 convert_uint8_uint64 convert_uint8_int64 convert_uint8_float64 convert_int8_uint8 convert_int8_uint16 convert_int8_int16 convert_int8_uint32 convert_int8_int32 convert_int8_float32 convert_int8_uint64 convert_int8_int64 convert_int8_float64 convert_uint16_uint8 convert_uint16_int8 convert_uint16_int16 convert_uint16_uint32 convert_uint16_int32 convert_uint16_float32 convert_uint16_uint64 convert_uint16_int64 convert_uint16_float64 convert_int16_uint8 convert_int16_int8 convert_int16_uint16 convert_int16_uint32 convert_int16_int32 convert_int16_float32 convert_int16_uint64 convert_int16_int64 convert_int16_float64 convert_uint32_uint8 convert_uint32_int8 convert_uint32_uint16 convert_uint32_int16 convert_uint32_int32 convert_uint32_float32 convert_uint32_uint64 convert_uint32_int64 convert_uint32_float64 convert_int32_uint8 convert_int32_int8 convert_int32_uint16 convert_int32_int16 convert_int32_uint32 convert_int32_float32 convert_int32_uint64 convert_int32_int64 convert_int32_float64 convert_uint64_uint8 convert_uint64_int8 convert_uint64_uint16 convert_uint64_int16 convert_uint64_uint32 convert_uint64_int32 convert_uint64_float32 convert_uint64_int64 convert_uint64_float64 convert_int64_uint8 convert_int64_int8 convert_int64_uint16 convert_int64_int16 convert_int64_uint32 convert_int64_int32 convert_int64_float32 convert_int64_uint64 convert_int64_float64 convert_float32_uint8 convert_float32_int8 convert_float32_uint16 convert_float32_int16 convert_float32_uint32 convert_float32_int32 convert_float32_uint64 convert_float32_int64 convert_float32_float64 convert_float64_uint8 convert_float64_int8 convert_float64_uint16 convert_float64_int16 convert_float64_uint32 convert_float64_int32 convert_float64_float32 convert_float64_uint64 convert_float64_int64 creat creat_excl creat_rdonly flist flist_invalid get64 get_bad_code get_bit get_char get_endian8 get_endian16 get_endian32 get_endian64 get_endian_float32_big get_endian_float32_arm get_endian_float32_little get_endian_float64_big get_endian_float64_arm get_endian_float64_little get_ff get_float32 get_float64 get_foffs get_fs get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 get_lincom2 get_lincom3 get_lincom_noin get_linterp get_linterp_noin get_linterp_notab get_multiply get_multiply_noin get_nonexistent get_null get_off64 get_phase get_recurse get_sf get_ss get_type get_uint16 get_uint32 get_uint64 legacy_get legacy_nframes legacy_nonexistent legacy_put legacy_spf nfields nfields_invalid nframes nframes64 nframes_empty nframes_invalid nframes_off64 nframes_spf open open_eaccess open_nonexistent open_notdirfile parse_badline parse_bit parse_bit4 parse_bit_bitnum parse_bit_bitsize parse_bit_ncols parse_bit_numbits parse_endian_bad parse_endian_big parse_endian_force parse_endian_little parse_foffs parse_include parse_include_nonexistent parse_index parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 parse_lincom_nfields parse_lincom_nofields parse_linterp parse_linterp_ncols parse_multiply parse_multiply_ncols parse_ncols parse_phase parse_phase_ncols parse_raw parse_raw_char parse_raw_ncols parse_raw_spf parse_raw_type parse_version parse_version_include put64 put_bad_code put_bit put_bof put_char put_endian8 put_endian16 put_endian32 put_endian64 put_endian_float32_arm put_endian_float32_big put_endian_float32_little put_endian_float64_arm put_endian_float64_big put_endian_float64_little put_ff put_float32 put_float64 put_foffs put_fs put_int8 put_int16 put_int32 put_int64 put_invalid put_lincom1 put_lincom2 put_lincom_noin put_linterp put_linterp_notab put_multiply put_null put_off64 put_phase put_phase_noin put_rdonly put_recurse put_rofs put_sf put_ss put_type put_uint16 put_uint32 put_uint64 spf spf_lincom spf_multiply spf_recurse trunc trunc_rdonly trunc_rofs flush_invalid parse_version_slash flush_all flush close_null close parse_endian_slash error_error parse_name parse_include_slash close_bad parse_foffs_slash flush_bad_code dfes_bit dfes_lincom dfes_linterp dfes_multiply dfes_null dfes_phase dfes_raw dfes_zero entry_bad_code entry_bit entry_invalid entry_lincom entry_linterp entry_multiply entry_phase entry_raw legacy_get_put legacy_get_rofs add_phase add_lincom_nfields add_raw add_multiply add_bit_bitsize flush_meta add_type add_raw_type add_bit_bitnum add_bit add_format add_raw_spf put_linterp_noin error_short error add add_linterp nfragments add_duplicate add_code add_bit_numbits add_lincom add_rdonly ascii_get ascii_put ascii_nframes slim_get slim_nframes slim_put add_many add_sort nfields_type nfields_type_invalid nmeta nmeta_invalid nmeta_parent nmeta_type nmeta_type_invalid nmeta_type_parent nmeta_vectors nmeta_vectors_invalid nmeta_vectors_parent nvectors nvectors_invalid parse_const parse_const_ncols parse_duplicate parse_meta parse_meta_parent parse_meta_raw parse_quote parse_sort parse_string parse_string_ncols parse_whitespace madd_linterp_invalid madd_lincom_invalid vlist_invalid vlist_meta add_raw_invalid cvlist_invalid svlist_invalid cvlist svlist madd_phase_invalid add_invalid madd_phase add_phase_invalid add_spec_directive add_string add_linterp_invalid madd_multiply flist_type_invalid clist cvlist_meta_invalid flist_meta_invalid flist_type svlist_meta_invalid cvlist_meta vlist_meta_invalid svlist_meta parse_string_null madd_linterp madd_lincom vlist add_bit_invalid add_lincom_invalid madd_bit_invalid madd_bit add_multiply_invalid add_const madd_multiply_invalid madd add_spec_invalid flist_type_meta_invalid add_spec flist_type_meta flist_meta parse_meta_index entry_raw_scalar_code parse_bit_scalar entry_raw_scalar_type entry_lincom_scalar entry_phase_scalar entry_raw_scalar parse_lincom_scalar entry_bit_scalar parse_raw_scalar parse_phase_scalar include include_nonexistent include_creat include_invalid include_accmode include_index madd_spec_directive madd_spec_invalid madd_spec parse_quote_mismatch parse_eol parse_foffs_include put_string parse_protect_data put_const put_string_protect ref put_const_protect parse_protect_all ref_none parse_ref add_protect parse_protect_format parse_protect_bad ref_two put_protect include_rdonly parse_ref_nonexistent parse_protect_none parse_name_pedantic parse_name_dot parse_name_ext parse_duplicate_ignore gzip_get gzip_nframes gzip_put gzip_get_get bzip_get bzip_nframes bzip_put bzip_get_get global_name open_cb_abort open_cb_cont open_cb_ignore open_cb_rescan open_cb_invalid del_const_force del_const del_derived_force del_const_deref del_meta_force del_data del_meta del del_derived close_discard global_ref_set global_ref_empty include_ignore global_ref include_ref include_auto move move_index move_protect move_data_enc_ar bzip_move_from gzip_move_from move_data_foffs move_data_enc_ra move_data_endian move_data_nop alter_multiply alter_bit_bitnum alter_entry_recode alter_linterp_move alter_raw_spf alter_entry alter_bit_numbits alter_lincom_slope alter_raw_type alter_lincom_input alter_const alter_phase alter_lincom_offset alter_linterp foffs_get foffs_move foffs_alter endian_alter endian_move endian_get encode_alter encode_get encode_move protect_alter move_subdir unclude_del name_move unclude file name file_type unclude_move file_code parent protect_get global_ref_get alter_mspec alter_spec include_cb include_pc include_syntax fragment_index fragment_name fragment_name_oor entry_type alter_polynom_coeff get_polynom_noin get_polynom put_polynom_noin madd_polynom parse_polynom_scalar alter_polynom_ord parse_polynom spf_polynom entry_polynom_scalar put_polynom1 put_polynom2 parse_polynom_ncols1 parse_polynom_ncols2 alter_polynom_input add_polynom entry_polynom parse_lincom_non_ncols parse_lincom_non get_lincom_non xz_get xz_nframes lzma_get lzma_nframes add_sbit parse_sbit put_sbit get_sbit madd_sbit flush_spec index_domain madd_clincom index madd_const index_range add_clincom add_cpolynom get_clincom convert_float32_complex64 convert_int32_complex128 get_endian_complex128_big get_endian_complex128_arm get_endian_complex128_little convert_complex64_float64 parse_meta_index2 convert_uint16_complex128 put_endian_complex64_arm put_endian_complex64_big put_endian_complex64_little convert_uint16_complex64 convert_float64_complex128 repr_int8 convert_complex64_int64 convert_uint64_complex64 convert_complex64_complex128 get_const convert_uint8_complex128 parse_meta_implicit2 convert_float32_complex128 get_complex64 add_spec_meta convert_float64_complex64 convert_int16_complex128 alter_cpolynom madd_cpolynom convert_int32_complex64 alter_lincom_23 convert_complex64_uint64 repr_uint8 put_complex128 get_endian_complex64_big get_endian_complex64_arm get_endian_complex64_little alter_spec_meta repr_real_a repr_real_i repr_real_m repr_real_r repr_int16 convert_uint8_complex64 repr_int32 madd_string convert_complex128_float64 repr_uint16 repr_int64 put_endian_complex128_arm put_endian_complex128_big put_endian_complex128_little get_complex128 repr_uint32 convert_complex128_uint64 get_const_repr convert_complex128_int64 repr_float32 repr_uint64 convert_int16_complex64 repr_float64 put_complex64 convert_uint64_complex128 convert_int64_complex64 repr_a repr_i repr_m repr_r get_const_complex convert_int8_complex128 convert_uint32_complex128 parse_meta_implicit get_cpolynom put_repr convert_complex128_complex64 convert_int8_complex64 convert_uint32_complex64 convert_int64_complex128 move_meta add_scalar alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 alter_entry_scalar4 get_zero entry_scalar_repr header_complex version_5_strict parse_version_permissive version_7_strict version_0 version_1 version_2 version_3 version_4 version_5 version_6 version_7 version_6_strict eof eof_index eof_lincom eof_phase bof bof_lincom bof_phase put_linterp_nomono get_linterp_sort put_linterp_reverse alter_lincom_32 parse_recip parse_divide alter_recip dfes_recip add_crecip89 add_divide put_divide madd_recip add_crecip get_recip_const spf_divide add_divide_invalid version_8 alter_crecip89 put_recip spf_recip madd_crecip89 alter_divide get_recip alter_crecip madd_divide dfes_divide madd_crecip add_recip get_divide version_8_strict version_5_write version_0_write version_7_write version_2_write version_4_write version_6_write version_1_write version_8_write version_3_write put_carray_slice cvlist_array_meta del_carray get_carray_slice cvlist_array del_carray_deref nmeta_vectors_del get_carray parse_carray madd_carray add_carray put_carray get_carray_len parse_carray_long alter_carray_len alter_carray_type ascii_get_get parse_include_relabs parse_include_absrel parse_include_relrel parse_include_absolute add_raw_include alter_crecip_zero alter_recip_zero + Makefile Makefile.in *.o *.odirfile *.swp *.exe .deps .libs convert_uint8_int8 convert_uint8_uint16 convert_uint8_int16 convert_uint8_uint32 convert_uint8_int32 convert_uint8_float32 convert_uint8_uint64 convert_uint8_int64 convert_uint8_float64 convert_int8_uint8 convert_int8_uint16 convert_int8_int16 convert_int8_uint32 convert_int8_int32 convert_int8_float32 convert_int8_uint64 convert_int8_int64 convert_int8_float64 convert_uint16_uint8 convert_uint16_int8 convert_uint16_int16 convert_uint16_uint32 convert_uint16_int32 convert_uint16_float32 convert_uint16_uint64 convert_uint16_int64 convert_uint16_float64 convert_int16_uint8 convert_int16_int8 convert_int16_uint16 convert_int16_uint32 convert_int16_int32 convert_int16_float32 convert_int16_uint64 convert_int16_int64 convert_int16_float64 convert_uint32_uint8 convert_uint32_int8 convert_uint32_uint16 convert_uint32_int16 convert_uint32_int32 convert_uint32_float32 convert_uint32_uint64 convert_uint32_int64 convert_uint32_float64 convert_int32_uint8 convert_int32_int8 convert_int32_uint16 convert_int32_int16 convert_int32_uint32 convert_int32_float32 convert_int32_uint64 convert_int32_int64 convert_int32_float64 convert_uint64_uint8 convert_uint64_int8 convert_uint64_uint16 convert_uint64_int16 convert_uint64_uint32 convert_uint64_int32 convert_uint64_float32 convert_uint64_int64 convert_uint64_float64 convert_int64_uint8 convert_int64_int8 convert_int64_uint16 convert_int64_int16 convert_int64_uint32 convert_int64_int32 convert_int64_float32 convert_int64_uint64 convert_int64_float64 convert_float32_uint8 convert_float32_int8 convert_float32_uint16 convert_float32_int16 convert_float32_uint32 convert_float32_int32 convert_float32_uint64 convert_float32_int64 convert_float32_float64 convert_float64_uint8 convert_float64_int8 convert_float64_uint16 convert_float64_int16 convert_float64_uint32 convert_float64_int32 convert_float64_float32 convert_float64_uint64 convert_float64_int64 creat creat_excl creat_rdonly flist flist_invalid get64 get_bad_code get_bit get_char get_endian8 get_endian16 get_endian32 get_endian64 get_endian_float32_big get_endian_float32_arm get_endian_float32_little get_endian_float64_big get_endian_float64_arm get_endian_float64_little get_ff get_float32 get_float64 get_foffs get_fs get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 get_lincom2 get_lincom3 get_lincom_noin get_linterp get_linterp_noin get_linterp_notab get_multiply get_multiply_noin get_nonexistent get_null get_off64 get_phase get_recurse get_sf get_ss get_type get_uint16 get_uint32 get_uint64 legacy_get legacy_nframes legacy_nonexistent legacy_put legacy_spf nfields nfields_invalid nframes nframes64 nframes_empty nframes_invalid nframes_off64 nframes_spf open open_eaccess open_nonexistent open_notdirfile parse_badline parse_bit parse_bit4 parse_bit_bitnum parse_bit_bitsize parse_bit_ncols parse_bit_numbits parse_endian_bad parse_endian_big parse_endian_force parse_endian_little parse_foffs parse_include parse_include_nonexistent parse_index parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 parse_lincom_nfields parse_lincom_nofields parse_linterp parse_linterp_ncols parse_multiply parse_multiply_ncols parse_ncols parse_phase parse_phase_ncols parse_raw parse_raw_char parse_raw_ncols parse_raw_spf parse_raw_type parse_version parse_version_include put64 put_bad_code put_bit put_bof put_char put_endian8 put_endian16 put_endian32 put_endian64 put_endian_float32_arm put_endian_float32_big put_endian_float32_little put_endian_float64_arm put_endian_float64_big put_endian_float64_little put_ff put_float32 put_float64 put_foffs put_fs put_int8 put_int16 put_int32 put_int64 put_invalid put_lincom1 put_lincom2 put_lincom_noin put_linterp put_linterp_notab put_multiply put_null put_off64 put_phase put_phase_noin put_rdonly put_recurse put_rofs put_sf put_ss put_type put_uint16 put_uint32 put_uint64 spf spf_lincom spf_multiply spf_recurse trunc trunc_rdonly trunc_rofs flush_invalid parse_version_slash flush_all flush close_null close parse_endian_slash error_error parse_name parse_include_slash close_bad parse_foffs_slash flush_bad_code dfes_bit dfes_lincom dfes_linterp dfes_multiply dfes_null dfes_phase dfes_raw dfes_zero entry_bad_code entry_bit entry_invalid entry_lincom entry_linterp entry_multiply entry_phase entry_raw legacy_get_put legacy_get_rofs add_phase add_lincom_nfields add_raw add_multiply add_bit_bitsize flush_meta add_type add_raw_type add_bit_bitnum add_bit add_format add_raw_spf put_linterp_noin error_short error add add_linterp nfragments add_duplicate add_code add_bit_numbits add_lincom add_rdonly ascii_get ascii_put ascii_nframes slim_get slim_nframes slim_put add_many add_sort nfields_type nfields_type_invalid nmeta nmeta_invalid nmeta_parent nmeta_type nmeta_type_invalid nmeta_type_parent nmeta_vectors nmeta_vectors_invalid nmeta_vectors_parent nvectors nvectors_invalid parse_const parse_const_ncols parse_duplicate parse_meta parse_meta_parent parse_meta_raw parse_quote parse_sort parse_string parse_string_ncols parse_whitespace madd_linterp_invalid madd_lincom_invalid vlist_invalid vlist_meta add_raw_invalid cvlist_invalid svlist_invalid cvlist svlist madd_phase_invalid add_invalid madd_phase add_phase_invalid add_spec_directive add_string add_linterp_invalid madd_multiply flist_type_invalid clist cvlist_meta_invalid flist_meta_invalid flist_type svlist_meta_invalid cvlist_meta vlist_meta_invalid svlist_meta parse_string_null madd_linterp madd_lincom vlist add_bit_invalid add_lincom_invalid madd_bit_invalid madd_bit add_multiply_invalid add_const madd_multiply_invalid madd add_spec_invalid flist_type_meta_invalid add_spec flist_type_meta flist_meta parse_meta_index entry_raw_scalar_code parse_bit_scalar entry_raw_scalar_type entry_lincom_scalar entry_phase_scalar entry_raw_scalar parse_lincom_scalar entry_bit_scalar parse_raw_scalar parse_phase_scalar include include_nonexistent include_creat include_invalid include_accmode include_index madd_spec_directive madd_spec_invalid madd_spec parse_quote_mismatch parse_eol parse_foffs_include put_string parse_protect_data put_const put_string_protect ref put_const_protect parse_protect_all ref_none parse_ref add_protect parse_protect_format parse_protect_bad ref_two put_protect include_rdonly parse_ref_nonexistent parse_protect_none parse_name_pedantic parse_name_dot parse_name_ext parse_duplicate_ignore gzip_get gzip_nframes gzip_put gzip_get_get bzip_get bzip_nframes bzip_put bzip_get_get global_name open_cb_abort open_cb_cont open_cb_ignore open_cb_rescan open_cb_invalid del_const_force del_const del_derived_force del_const_deref del_meta_force del_data del_meta del del_derived close_discard global_ref_set global_ref_empty include_ignore global_ref include_ref include_auto move move_index move_protect move_data_enc_ar bzip_move_from gzip_move_from move_data_foffs move_data_enc_ra move_data_endian move_data_nop alter_multiply alter_bit_bitnum alter_entry_recode alter_linterp_move alter_raw_spf alter_entry alter_bit_numbits alter_lincom_slope alter_raw_type alter_lincom_input alter_const alter_phase alter_lincom_offset alter_linterp foffs_get foffs_move foffs_alter endian_alter endian_move endian_get encode_alter encode_get encode_move protect_alter move_subdir unclude_del name_move unclude file name file_type unclude_move file_code parent protect_get global_ref_get alter_mspec alter_spec include_cb include_pc include_syntax fragment_index fragment_name fragment_name_oor entry_type alter_polynom_coeff get_polynom_noin get_polynom put_polynom_noin madd_polynom parse_polynom_scalar alter_polynom_ord parse_polynom spf_polynom entry_polynom_scalar put_polynom1 put_polynom2 parse_polynom_ncols1 parse_polynom_ncols2 alter_polynom_input add_polynom entry_polynom parse_lincom_non_ncols parse_lincom_non get_lincom_non xz_get xz_nframes lzma_get lzma_nframes add_sbit parse_sbit put_sbit get_sbit madd_sbit flush_spec index_domain madd_clincom index madd_const index_range add_clincom add_cpolynom get_clincom convert_float32_complex64 convert_int32_complex128 get_endian_complex128_big get_endian_complex128_arm get_endian_complex128_little convert_complex64_float64 parse_meta_index2 convert_uint16_complex128 put_endian_complex64_arm put_endian_complex64_big put_endian_complex64_little convert_uint16_complex64 convert_float64_complex128 repr_int8 convert_complex64_int64 convert_uint64_complex64 convert_complex64_complex128 get_const convert_uint8_complex128 parse_meta_implicit2 convert_float32_complex128 get_complex64 add_spec_meta convert_float64_complex64 convert_int16_complex128 alter_cpolynom madd_cpolynom convert_int32_complex64 alter_lincom_23 convert_complex64_uint64 repr_uint8 put_complex128 get_endian_complex64_big get_endian_complex64_arm get_endian_complex64_little alter_spec_meta repr_real_a repr_real_i repr_real_m repr_real_r repr_int16 convert_uint8_complex64 repr_int32 madd_string convert_complex128_float64 repr_uint16 repr_int64 put_endian_complex128_arm put_endian_complex128_big put_endian_complex128_little get_complex128 repr_uint32 convert_complex128_uint64 get_const_repr convert_complex128_int64 repr_float32 repr_uint64 convert_int16_complex64 repr_float64 put_complex64 convert_uint64_complex128 convert_int64_complex64 repr_a repr_i repr_m repr_r get_const_complex convert_int8_complex128 convert_uint32_complex128 parse_meta_implicit get_cpolynom put_repr convert_complex128_complex64 convert_int8_complex64 convert_uint32_complex64 convert_int64_complex128 move_meta add_scalar alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 alter_entry_scalar4 get_zero entry_scalar_repr header_complex version_5_strict parse_version_permissive version_7_strict version_0 version_1 version_2 version_3 version_4 version_5 version_6 version_7 version_6_strict eof eof_index eof_lincom eof_phase bof bof_lincom bof_phase put_linterp_nomono get_linterp_sort put_linterp_reverse alter_lincom_32 parse_recip parse_divide alter_recip dfes_recip add_crecip89 add_divide put_divide madd_recip add_crecip get_recip_const spf_divide add_divide_invalid version_8 alter_crecip89 put_recip spf_recip madd_crecip89 alter_divide get_recip alter_crecip madd_divide dfes_divide madd_crecip add_recip get_divide version_8_strict version_5_write version_0_write version_7_write version_2_write version_4_write version_6_write version_1_write version_8_write version_3_write put_carray_slice cvlist_array_meta del_carray get_carray_slice cvlist_array del_carray_deref nmeta_vectors_del get_carray parse_carray madd_carray add_carray put_carray get_carray_len parse_carray_long alter_carray_len alter_carray_type ascii_get_get parse_include_relabs parse_include_absrel parse_include_relrel parse_include_absolute add_raw_include alter_crecip_zero alter_recip_zero error_num Modified: trunk/getdata/test/Makefile.am =================================================================== --- trunk/getdata/test/Makefile.am 2011-04-19 16:17:06 UTC (rev 579) +++ trunk/getdata/test/Makefile.am 2011-04-19 22:51:58 UTC (rev 580) @@ -1,4 +1,4 @@ -# (C) 2008-2010 D. V. Wiebe +# (C) 2008-2011 D. V. Wiebe # ########################################################################## # @@ -145,7 +145,7 @@ EOF_TESTS=eof eof_index eof_lincom eof_phase -ERROR_TESTS=error error_error error_short +ERROR_TESTS=error error_error error_num error_short FILE_TESTS=file file_code file_type Added: trunk/getdata/test/error_num.c =================================================================== --- trunk/getdata/test/error_num.c (rev 0) +++ trunk/getdata/test/error_num.c 2011-04-19 22:51:58 UTC (rev 580) @@ -0,0 +1,57 @@ +/* Copyright (C) 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 obtain an error string */ +#include "test.h" + +#include <stdlib.h> +#include <sys/stat.h> +#include <sys/types.h> +#include <fcntl.h> +#include <string.h> + +int main(void) +{ + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + char string[1000] = ""; + int ne1, ne2, 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_validate(D, "1"); + gd_validate(D, "2"); + gd_validate(D, "3"); + ne1 = gd_error_count(D); + ne2 = gd_error_count(D); + gd_close(D); + + unlink(format); + rmdir(filedir); + + CHECKI(ne1, 3); + CHECKI(ne2, 0); + + return r; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-19 16:17:13
|
Revision: 579 http://getdata.svn.sourceforge.net/getdata/?rev=579&view=rev Author: ketiltrout Date: 2011-04-19 16:17:06 +0000 (Tue, 19 Apr 2011) Log Message: ----------- (roff -> html)ifier. Modified Paths: -------------- trunk/getdata/man/Makefile.am trunk/getdata/man/gd_add_bit.3 trunk/getdata/man/gd_alter_bit.3 trunk/getdata/man/gd_carrays.3 trunk/getdata/man/gd_cbopen.3 Added Paths: ----------- trunk/getdata/man/make_html.pl Modified: trunk/getdata/man/Makefile.am =================================================================== --- trunk/getdata/man/Makefile.am 2011-04-18 22:24:02 UTC (rev 578) +++ trunk/getdata/man/Makefile.am 2011-04-19 16:17:06 UTC (rev 579) @@ -84,14 +84,13 @@ $(addsuffix .html,$(dist_man_MANS)) %.html: % - man2html -r $< | tail -n +2 | $(SED) -e 's/~/\ /g' | head -n -7 > $@ - echo "</BODY></HTML>" >> $@ + ./make_html.pl $< > $@ htmlman: $(HTMLMANS) for m in $(MAN3ALIASES); do \ - rm -f `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \ - $(LN_S) `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/:/ /'`; \ - done + ./make_html.pl `echo $$m | $(SED) -e 's/:\\(.*\\).3/ \\1/'` \ + > `echo $$m | $(SED) -e 's/3/3.html/g' | $(SED) -e 's/.*://'`; \ + done install-data-hook: cd $(DESTDIR)$(mandir)/man3 && \ Modified: trunk/getdata/man/gd_add_bit.3 =================================================================== --- trunk/getdata/man/gd_add_bit.3 2011-04-18 22:24:02 UTC (rev 578) +++ trunk/getdata/man/gd_add_bit.3 2011-04-19 16:17:06 UTC (rev 579) @@ -275,6 +275,7 @@ .nf .B #define GD_C89_API .B #include <getdata.h> +.fi .HP .nh .ad l @@ -291,7 +292,6 @@ .BI "int " fragment_index ); .hy .ad n -.fi .PP In this case, the array pointers passed as .IR cm ,\~ cb Modified: trunk/getdata/man/gd_alter_bit.3 =================================================================== --- trunk/getdata/man/gd_alter_bit.3 2011-04-18 22:24:02 UTC (rev 578) +++ trunk/getdata/man/gd_alter_bit.3 2011-04-19 16:17:06 UTC (rev 579) @@ -253,6 +253,7 @@ .nf .B #define GD_C89_API .B #include <getdata.h> +.fi .HP .nh .ad l @@ -267,7 +268,6 @@ .BI "const char *" in_field ", double " cdividend [2]); .hy .ad n -.fi .PP In this case, the array pointers passed as .IR cm ,\~ cb Modified: trunk/getdata/man/gd_carrays.3 =================================================================== --- trunk/getdata/man/gd_carrays.3 2011-04-18 22:24:02 UTC (rev 578) +++ trunk/getdata/man/gd_carrays.3 2011-04-19 16:17:06 UTC (rev 579) @@ -1,4 +1,4 @@ -.\" gd_constants.3. The gd_constants man page. +.\" gd_carrays.3. The gd_carrays man page. .\" .\" Copyright (C) 2010 D. V. Wiebe .\" @@ -15,7 +15,7 @@ .\" .TH gd_carrays 3 "3 November 2010" "Version 0.7.0" "GETDATA" .SH NAME -gd_constants \(em retrieve a list of CARRAY values from a dirfile +gd_carrays \(em retrieve a list of CARRAY values from a dirfile .SH SYNOPSIS .B #include <getdata.h> .HP Modified: trunk/getdata/man/gd_cbopen.3 =================================================================== --- trunk/getdata/man/gd_cbopen.3 2011-04-18 22:24:02 UTC (rev 578) +++ trunk/getdata/man/gd_cbopen.3 2011-04-19 16:17:06 UTC (rev 579) @@ -397,6 +397,7 @@ type is a structure with at least the following members: .in +4n +.fam C .nf typedef struct { const DIRFILE* dirfile; @@ -409,6 +410,7 @@ ... } gd_parser_data_t; .fi +.fam .in .PP The Added: trunk/getdata/man/make_html.pl =================================================================== --- trunk/getdata/man/make_html.pl (rev 0) +++ trunk/getdata/man/make_html.pl 2011-04-19 16:17:06 UTC (rev 579) @@ -0,0 +1,240 @@ +#!/usr/bin/perl -w + +use strict; + +die unless $ARGV[0]; +my $f = $ARGV[0]; +my $a = $ARGV[1]; +my $html = ""; + +sub Splitify { + my @t; + my $q = 0; + my $t = undef; + + my @c = split //, shift; + for (@c) { + if (/"/) { + $q = 1 - $q; + } elsif (/ /) { + if ($q) { + $t .= " "; + } elsif (defined $t) { + push @t, $t; + $t = undef; + } + } elsif (/[\S]/) { + $t .= $_; + } else { + die $_; + } + } + + push @t, $t if defined $t; + + @t; +} + +sub Alternate { + my $s = 0; + my $h = ""; + my @t = Splitify($_[4]); + + for (@t) { + $h .= $_[$s] . $_ . $_[$s + 1]; + $s = 2 - $s; + } + + $h; +} + +my $dl = 0; +my $ul = 0; +my $nf = 0; +my $header = 0; +my $table = 0; +open F, $f or die $!; +while(<F>) { + next if (/^\.\\"/); + chomp; + $_ = ".PP" if ($_ eq "" and not $nf); + $_ = ".IP" if ($_ =~ /\.in /); + $_ = ".PP" if ($_ eq ".in"); + s/&/&/g; + s/</</g; + s/>/>/g; + s/\\\(em/—/g; + + s/ / /g if ($nf and not /^\./); + + # sugar + s/\*\*([0-9]*)/<sup>$1<\/sup>/; + + if ($table) { + if (/center tab/) { + $html .= '<DIV CLASS="inset"><TABLE>'; + $header = 1; + } elsif (/^\.TE/) { + $html .= "</TABLE></DIV"; + $table = 0; + } elsif (/cbscbs/ or /rlrl/) { + ; + } else { + if ($header) { + s/\|/<\/TH><TH colspan=\"2\">/g; + $html .= "<TR><TH colspan=\"2\">$_</TH></TR>"; + $header = 0; + } else { + s/\|/<\/TD><TD>/g; + $html .= "<TR><TD>$_</TD></TR>"; + } + } + next; + } + + if (/^\.TH (gd_\w*) 3 "(.*?)" "(.*?)"/) { + my $vers = $3; + my $date = $2; + my $func = $a || $1; + $html .= '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" ' . + '"http://www.w3.org/TR/html4/strict.dtd"><HTML><HEAD>' . + '<META http-equiv="Content-Type" content="text/html;charset=utf-8" >' . + '<LINK REL="stylesheet" HREF="/getdata.css" TYPE="text/css"><TITLE>' . + $func . '(3) Manual Page</TITLE></HEAD><BODY><H1>' . $func . "(3)</H1>"; + } elsif (/^[^.]/) { + $html .= $_ . " "; + } elsif (/^\.B (.*)/) { + if ($dl == 2) { + $html .= "<DT><B>$1</B></DT><DD>"; + $dl = 1; + } else { + $html .= "<B>$1</B> "; + } + } elsif (/^\.BI (.*)/) { + if ($dl == 2) { + $html .= "<DT>"; + $html .= Alternate("<B>", "</B>", "<I>", "</I>", $1) . " "; + $html .= "</DT><DD>"; + $dl = 1; + } else { + $html .= Alternate("<B>", "</B>", "<I>", "</I>", $1) . " "; + } + } elsif (/^\.BR (.*)/) { + if ($dl == 2) { + $html .= "<DT>"; + $html .= Alternate("<B>", "</B>", "", "", $1) . " "; + $html .= "</DT><DD>"; + $dl = 1; + } else { + $html .= Alternate("<B>", "</B>", "", "", $1) . " "; + } + } elsif (/^\.HP$/) { + if ($dl == 1) { $html .= "</DD></DL>"; $dl = 0; }; + if ($ul == 1) { $html .= "</UL>"; $ul = 0; }; + + $html .= '<P class="hang">'; + } elsif (/^\.I (.*)/) { + $html .= "<I>$1</I> "; + } elsif (/^\.IB (.*)/) { + if ($dl == 2) { + $html .= "<DT>"; + $html .= Alternate("<I>", "</I>", "<B>", "</B>", $1) . " "; + $html .= "</DT><DD>"; + $dl = 1; + } else { + $html .= Alternate("<I>", "</I>", "<B>", "</B>", $1) . " "; + } + } elsif (/^\.IP \\\(bu/) { + if ($dl == 1) { $html .= "</DD></DL>"; $dl = 0; }; + if ($ul == 1) { + $html .= "<LI>"; + } else { + $html .= "<UL><LI>"; + $ul = 1; + } + } elsif (/^\.IP/) { + if ($dl == 1) { $html .= "</DD></DL>"; $dl = 0; }; + if ($ul == 1) { $html .= "</UL>"; $ul = 0; }; + + $html .= '<P class="inset">'; + } elsif (/^\.IR (.*)/) { + $html .= Alternate("<I>", "</I>", "", "", $1) . " "; + } elsif (/^\.PP$/) { + if ($dl == 1) { $html .= "</DD></DL>"; $dl = 0; }; + if ($ul == 1) { $html .= "</UL>"; $ul = 0; }; + + $html .= "<P>"; + } elsif (/^\.PD/) { + ; + } elsif (/^\.RB (.*)/) { + if ($dl == 2) { + $html .= "<DT>"; + $html .= Alternate("", "", "<B>", "</B>", $1) . " "; + $html .= "</DT><DD>"; + $dl = 1; + } else { + $html .= Alternate("", "", "<B>", "</B>", $1) . " "; + } + } elsif (/^\.RE/) { + $html .= '</DIV>'; + } elsif (/^\.RI (.*)/) { + if ($dl == 2) { + $html .= "<DT>"; + $html .= Alternate("", "", "<I>", "</I>", $1) . " "; + $html .= "</DT><DD>"; + $dl = 1; + } else { + $html .= Alternate("", "", "<I>", "</I>", $1) . " "; + } + } elsif (/^\.RS/) { + $html .= '<DIV CLASS="inset">' + } elsif (/^\.SH (.*)/) { + if ($dl == 1) { $html .= "</DD></DL>"; $dl = 0; }; + if ($ul == 1) { $html .= "</UL>"; $ul = 0; }; + + $html .= "<H2>$1</H2>"; + } elsif (/^\.SS (.*)/) { + if ($dl == 1) { $html .= "</DD></DL>"; $dl = 0; }; + if ($ul == 1) { $html .= "</UL>"; $ul = 0; }; + + $html .= "<H3>$1</H3>"; + } elsif (/^\.TP/) { + if ($ul == 1) { $html .= "</UL>"; $ul = 0; }; + + if ($dl == 1) { + $html .= "</DD>"; $dl = 0; + } else { + $html .= "<DL>"; + } + $dl = 2; + next; + } elsif (/\.TS/) { + $table = 1; + } elsif (/\.fam C/) { + $html .= "<tt>"; + next; + } elsif (/\.fam/) { + $html .= "</tt>"; + next; + } elsif (/\.fi/) { + $nf = 0; + next; + } elsif (/\.nf/) { + $nf = 1; + next; + } elsif (/^\.(?:nh|ad|hy)/) { + ; # ignored + } else { + die $_ if ($dl == 2); + print STDERR $_, "\n" if /^\./; + $html .= $_; + } + $html .= "<BR>" if $nf; +} +$html .= "</BODY></HTML>"; + +$html =~ s/\\~/ /g; +$html =~ s/(<B>(gd_\w*?)<\/B>\(3\))/<A HREF="$2.3.html">$1<\/A>/g; + +print $html; + Property changes on: trunk/getdata/man/make_html.pl ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-18 22:24:08
|
Revision: 578 http://getdata.svn.sourceforge.net/getdata/?rev=578&view=rev Author: ketiltrout Date: 2011-04-18 22:24:02 +0000 (Mon, 18 Apr 2011) Log Message: ----------- Corrections Modified Paths: -------------- trunk/html/getdata.css trunk/html/getdata.html Modified: trunk/html/getdata.css =================================================================== --- trunk/html/getdata.css 2011-04-09 00:24:16 UTC (rev 577) +++ trunk/html/getdata.css 2011-04-18 22:24:02 UTC (rev 578) @@ -88,10 +88,15 @@ } p.inset { - margin-left: 2em; - margin-right: 2em; + padding-left: 2em; + padding-right: 2em; } +p.hang { + text-indent: -2em; + padding-left: 2em; +} + span.manlink { font-size: small; font-weight: normal; Modified: trunk/html/getdata.html =================================================================== --- trunk/html/getdata.html 2011-04-09 00:24:16 UTC (rev 577) +++ trunk/html/getdata.html 2011-04-18 22:24:02 UTC (rev 578) @@ -1149,8 +1149,12 @@ class="syntax">gd_nfragments()</span></a>. The function will return either <span class="syntax literal">GD_BIG_ENDIAN</span> or - <span class="syntax literal">GD_LITTLE_ENDIAN</span>, or else zero on - error. + <span class="syntax literal">GD_LITTLE_ENDIAN</span>, bitwise-or'd with + <span class="syntax literal">GD_ARM_ENDIAN</span> or <span + class="syntax literal">GD_NOT_ARM_ENDIAN</span>. (The last of these, + <span class="syntax literal">GD_NOT_ARM_ENDIAN</span> is zero on all but + middle-ended ARM systems and, so, can be ignored if portability on such + ARM processors is not needed.) On error, it returns zero. <h3><a name="gd_frameoffset">gd_frameoffset()</a> <span class="manlink"><a @@ -1560,7 +1564,7 @@ the corresponding element of the <span class="syntax identifier">scalar</span> array will be <span class="syntax literal">NULL</span>, and the corresponding element of <span - class="syntax identifier">scalar</span> will be uninitialised. The + class="syntax identifier">scalar_ind</span> will be uninitialised. The number of initialised elements in the array, and their meanings depend on the type of the field described, and are presented in Table 5. <div class="inset"> @@ -1852,10 +1856,10 @@ fields. All these functions return a pointer to an array of strings allocated by the library. The list is terminated by a <span class="syntax literal">NULL</span> pointer. You should not free the - list, it will be freed when <a href="#gd_close"><span + list: it will be freed when <a href="#gd_close"><span class="syntax">gd_close()</span></a> is called. The pointer returned is guaranteed to be valid only until the same list function is - called with the same arguments; however the list may be out of date, if + called with the same arguments; however the list may be out-of-date, if the dirfile metadata has been modified since the call was made. On error these functions return <span class="syntax literal">NULL</span>. @@ -1874,8 +1878,8 @@ A <span class="syntax literal">NULL</span>-terminated array of strings is returned. This list does not include metafields. The number of non-<span class="syntax literal">NULL</span> elements in the array will be - equal to the number returned by <a href="#gd_nframes"><span - class="syntax">gd_nframes()</span></a>. + equal to the number returned by <a href="#gd_nfields"><span + class="syntax">gd_nfields()</span></a>. <h3><a name="gd_vector_list">gd_vector_list()</a> <span class="manlink"><a @@ -2119,7 +2123,12 @@ class="identifier">recode</span><span class="operator">);</span> </div> where <span class="syntax identifier">byte_sex</span> should be one - of the expressions listed in Table 6. + of the expressions listed in Table 6, bitwise or'd with either <span + class="syntax literal">GD_ARM_ENDIAN</span> or <span class="syntax + literal">GD_NOT_ARM_ENDIAN</span>. (The last of these, <span + class="syntax literal">GD_NOT_ARM_ENDIAN</span> is zero on all but + middle-ended ARM systems and, so, can be omitted if portability on such + ARM processors is not needed.)<p> If <span class="syntax identifier">recode</span> is non-zero, the associated binary files will be byte-swapped, if the current encoding scheme requires it. This function returns zero on success or -1 on error. @@ -3215,7 +3224,7 @@ <span class="keyword">int</span> <span class="identifier">flags</span><span class="operator">);</span> </div> - where <span class="syntax identifier">field</span> should be zero, or + where <span class="syntax identifier">flags</span> should be zero, or else a bitwise or'd collection of the flags listed in Table 7. <div class="inset"> <table> @@ -3738,8 +3747,13 @@ <p><a name="datatype">Data types</a> are specified by arguments of type <span class="syntax keyword">gd_type_t</span>, which should be one of the symbols listed in Table 8. Signed integer types refer to - two's-complement data, and floating point types refer to IEEE 754-1985 - conformant data. + two's-complement data, and floating point types refer to <a + href="http://grouper.ieee.org/groups/754/">IEEE 754-1985</a> + conformant data. Complex valued data consist of two consecutive floating + point numbers, the first being the real part of the complex number and the + second the imaginary part. This corresponds to the storage convention + mandated by C99 which is also the storage convention mandated by + FORTRAN-77 for complex valued data. <div class="inset"> <table> <caption><b>Table 8:</b> Data types</caption> @@ -3769,10 +3783,10 @@ floating point number</td> </tr> <tr> - <td class="syntax">GD_COMPLEX64</td><td>A C99-compatible single - precision complex number</td> - <td class="syntax">GD_COMPLEX128</td><td>A C99-compatible double - precision complex number</td> + <td class="syntax">GD_COMPLEX64</td><td>A 64-bit (single precision) + floating point complex number</td> + <td class="syntax">GD_COMPLEX128</td><td>A 128-bit (double + precision) floating point complex number</td> </tr> <tr> <td class="syntax">GD_NULL</td><td>The null type</td> @@ -3812,11 +3826,12 @@ Here <span class="syntax identifier">return_type</span> identifies the desired type of the returned data, which need not be the same as the type of the data in the dirfile. Type conversion will be performed as - necessary. If <span class="syntax identifier">return_type</span> is - <span class="syntax literal">GD_NULL</span>, no data is returned, and - <span class="syntax identifier">data_out</span> is ignored. This - function returns the number of samples (not frames) successfully read, - or zero on error. + necessary. This function returns the number of samples (not frames) + successfully read, or zero on error. If <span class="syntax + identifier">return_type</span> is <span class="syntax + literal">GD_NULL</span>, no data is returned, and <span class="syntax + identifier">data_out</span> is ignored; however, the number of samples + read is still returned. <h3><a name="gd_get_constant">gd_get_constant()</a><span class="manlink"><a href="man3/gd_get_constant.3.html">man This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-09 00:24:22
|
Revision: 577 http://getdata.svn.sourceforge.net/getdata/?rev=577&view=rev Author: ketiltrout Date: 2011-04-09 00:24:16 +0000 (Sat, 09 Apr 2011) Log Message: ----------- Remove the footer from htmlised man pages. Modified Paths: -------------- trunk/getdata/man/Makefile.am trunk/html/Makefile Modified: trunk/getdata/man/Makefile.am =================================================================== --- trunk/getdata/man/Makefile.am 2011-04-08 23:51:57 UTC (rev 576) +++ trunk/getdata/man/Makefile.am 2011-04-09 00:24:16 UTC (rev 577) @@ -84,7 +84,8 @@ $(addsuffix .html,$(dist_man_MANS)) %.html: % - man2html -r $< | tail -n +2 | $(SED) -e 's/~/\ /g' > $@ + man2html -r $< | tail -n +2 | $(SED) -e 's/~/\ /g' | head -n -7 > $@ + echo "</BODY></HTML>" >> $@ htmlman: $(HTMLMANS) for m in $(MAN3ALIASES); do \ Modified: trunk/html/Makefile =================================================================== --- trunk/html/Makefile 2011-04-08 23:51:57 UTC (rev 576) +++ trunk/html/Makefile 2011-04-09 00:24:16 UTC (rev 577) @@ -1,11 +1,23 @@ -SRC_DIR=../../branches/getdata-0.7 +SRC_DIR=$(abspath ../getdata) +CWD=$(abspath .) .PHONY: man3 man3: - rm -rf man3 - mkdir man3 + if [ ! -d man3 ]; then rm -rf man3 && mkdir man3; fi cd $(SRC_DIR)/man && $(MAKE) htmlman - cp $(SRC_DIR)/man/*3.html man3 + ( cd man3 && \ + for x in *3.html; do \ + if [ ! -e $(SRC_DIR)/man/$$x ]; then rm -vf $$x; fi; \ + done \ + ) + ( cd $(SRC_DIR)/man && \ + for x in *3.html; do \ + if [ ! -e ${CWD}/man3/$$x ] || \ + ! diff -q $$x ${CWD}/man3/$$x > /dev/null 2>&1; then \ + cp -vf $$x ${CWD}/man3/$$x; \ + fi; \ + done; \ + ) PUBLIC_HTML=index.html api.html bindings.html dirfile.html download.html \ encoding.html getdata.html getdata.css dirfile.png valid_html.png \ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-08 23:52:04
|
Revision: 576 http://getdata.svn.sourceforge.net/getdata/?rev=576&view=rev Author: ketiltrout Date: 2011-04-08 23:51:57 +0000 (Fri, 08 Apr 2011) Log Message: ----------- Copy edit. Modified Paths: -------------- trunk/getdata/man/gd_add.3 trunk/getdata/man/gd_add_bit.3 trunk/getdata/man/gd_alter_encoding.3.in trunk/getdata/man/gd_alter_endianness.3.in trunk/getdata/man/gd_alter_frameoffset.3.in trunk/getdata/man/gd_cbopen.3 trunk/getdata/man/gd_dirfile_standards.3 trunk/getdata/man/gd_entry.3 trunk/getdata/man/gd_field_list_by_type.3 trunk/getdata/man/gd_get_carray_slice.3 trunk/getdata/man/gd_get_constant.3 trunk/getdata/man/gd_include.3 trunk/getdata/man/gd_put_carray_slice.3 Modified: trunk/getdata/man/gd_add.3 =================================================================== --- trunk/getdata/man/gd_add.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_add.3 2011-04-08 23:51:57 UTC (rev 576) @@ -179,7 +179,7 @@ a call to .BR gd_error_string (3). .SH NOTES -GetData artifically limits the number of elements in a +GetData artificially limits the number of elements in a .B CARRAY to the value of the symbol GD_MAX_CARRAY_LENGTH defined in getdata.h. This is done to be certain that the Modified: trunk/getdata/man/gd_add_bit.3 =================================================================== --- trunk/getdata/man/gd_add_bit.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_add_bit.3 2011-04-08 23:51:57 UTC (rev 576) @@ -259,7 +259,7 @@ .BR gd_error_string (3). .SH NOTES -GetData artifically limits the number of elements in a +GetData artificially limits the number of elements in a .B CARRAY to the value of the symbol GD_MAX_CARRAY_LENGTH defined in getdata.h. This is done to be certain that the Modified: trunk/getdata/man/gd_alter_encoding.3.in =================================================================== --- trunk/getdata/man/gd_alter_encoding.3.in 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_alter_encoding.3.in 2011-04-08 23:51:57 UTC (rev 576) @@ -54,12 +54,12 @@ .BR GD_LZMA_ENCODED ,\~ GD_SLIM_ENCODED ,\~ GD_TEXT_ENCODED . .ad n .hy -.P +.PP See .BR gd_cbopen (3) and dirfile-encoding(5) for the meanings of these symbols and details on the supported encoding schemes. -.P +.PP In addition to being simply a valid fragment index, .I fragment_index may also be the special value @@ -116,7 +116,7 @@ .TP .B GD_E_UNSUPPORTED The encoding scheme of the fragment does not support binary file recoding. -.P +.PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from Modified: trunk/getdata/man/gd_alter_endianness.3.in =================================================================== --- trunk/getdata/man/gd_alter_endianness.3.in 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_alter_endianness.3.in 2011-04-08 23:51:57 UTC (rev 576) @@ -61,7 +61,7 @@ .RB ( GD_BIG_ENDIAN " | " GD_LITTLE_ENDIAN ) Indicating that the byte sex should be the opposite of the native endianness of the host, whichever that may be. -.P +.PP Furthermore, any of these may be bitwise or'd with .B GD_ARM_ENDIAN @@ -69,7 +69,7 @@ .B GD_NOT_ARM_ENDIAN indicating that the floating point data are stored in the ARM middle-endian format. -.P +.PP In addition to being simply a valid fragment index, .I fragment_index may also be the special value @@ -126,7 +126,7 @@ .TP .B GD_E_UNSUPPORTED The encoding scheme of the fragment does not support binary file byte swapping. -.P +.PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from Modified: trunk/getdata/man/gd_alter_frameoffset.3.in =================================================================== --- trunk/getdata/man/gd_alter_frameoffset.3.in 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_alter_frameoffset.3.in 2011-04-08 23:51:57 UTC (rev 576) @@ -109,7 +109,7 @@ .TP .B GD_E_UNSUPPORTED The encoding scheme of the fragment does not support binary file shifting. -.P +.PP The dirfile error may be retrieved by calling .BR gd_error (3). A descriptive error string for the last error encountered can be obtained from Modified: trunk/getdata/man/gd_cbopen.3 =================================================================== --- trunk/getdata/man/gd_cbopen.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_cbopen.3 2011-04-08 23:51:57 UTC (rev 576) @@ -162,7 +162,7 @@ directives (see .BR dirfile-format (5)) found in the dirfile format specification should be ignored. All raw data will -be assumed to have the byte sex indicated through the presence or absense of the +be assumed to have the byte sex indicated through the presence or absence of the .BR GD_ARM_ENDIAN ,\~ GD_BIG_ENDIAN ,\~ GD_LITTLE_ENDIAN , and .B GD_NOT_ARM_ENDIAN @@ -267,16 +267,16 @@ successfully performed on the dirfile. Once the library has determined the encoding scheme for the first time, it remembers it for subsequent calls. .TP -.B GD_BZIP2_ENDODED +.B GD_BZIP2_ENCODED Specifies that raw data files are compressed using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding, as implemented in the bzip2 format. .TP -.B GD_GZIP_ENDODED +.B GD_GZIP_ENCODED Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77) as implemented in the gzip format. .TP -.B GD_LZMA_ENDODED +.B GD_LZMA_ENCODED Specifies that raw data files are compressed using the Lempel-Ziv Markov Chain Algorithm (LZMA) as implemented in the xz container format. .TP @@ -303,7 +303,7 @@ .I permissive mode, in which much non-Standards compliant syntax is allowed, and a -.I pedanitc +.I pedantic mode, in which the parser adheres strictly to the Standards. If .B GD_PEDANTIC is passed to @@ -651,7 +651,7 @@ .B ENDIAN directive), GetData assumes the dirfile has native byte sex, even though, officially, these early Standards stipulated data to be little-endian. This is -necessary since, in the absense of an explicit +necessary since, in the absence of an explicit .B /VERSION directive, it is often impossible to determine the intended Standards Version of a dirfile, and the current behaviour is to assume native byte sex for modern @@ -663,12 +663,12 @@ .B GD_LITTLE_ENDIAN should be specified by the caller. -GetData artifically limits the size of a +GetData artificially limits the size of a .B CARRAY field to GD_MAX_CARRAY_LENGTH elements, to be certain it is always able to write the CARRAY back to disk without overrunning its maximum line length. On 32-bit systems, GD_MAX_CARRAY_LENGTH is 2**24. It is larger on 64-bit -systems. Excess elements are silently truncatd on dirfile open. +systems. Excess elements are silently truncated on dirfile open. GetData's parser assumes it is running on an ASCII-compatible platform. Format specification parsing will fail gloriously on an EBCDIC platform. Modified: trunk/getdata/man/gd_dirfile_standards.3 =================================================================== --- trunk/getdata/man/gd_dirfile_standards.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_dirfile_standards.3 2011-04-08 23:51:57 UTC (rev 576) @@ -28,7 +28,7 @@ .SH DESCRIPTION The .BR gd_dirfile_standards () -version updates the current Standards Version for the open dirfile +function updates the current Standards Version for the open dirfile .I dirfile to the value specified by .IR version , Modified: trunk/getdata/man/gd_entry.3 =================================================================== --- trunk/getdata/man/gd_entry.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_entry.3 2011-04-08 23:51:57 UTC (rev 576) @@ -223,7 +223,7 @@ .B PHASE fields, the first element corresponds to .IR shift . -The remainder are unitialised. +The remainder are uninitialised. .IP \(bu 4 For .B POLYNOM @@ -237,13 +237,13 @@ .B RECIP fields, the first element corresponds to .IR cdividend . -The remainder are unitialised. +The remainder are uninitialised. .IP \(bu 4 For .B RAW fields, the first element corresponds to .IR spf . -The remainder are unitialised. +The remainder are uninitialised. .PP The .I scalar @@ -735,26 +735,26 @@ gd_spf_t|spf|gd_spf_t|u.raw.spf gd_type_t|data_type|gd_type_t|u.raw.data_type int|n_fields|int|u.lincom.n_fields -double compex|cm[3]|double|u.lincom.cm[3][2] +double complex|cm[3]|double|u.lincom.cm[3][2] double|m[3]|double|u.lincom.m[3] -double compex|cb[3]|double|u.lincom.cb[3][2] +double complex|cb[3]|double|u.lincom.cb[3][2] double|b[3]|double|u.lincom.b[3] int|poly_ord|int|u.polynom.poly_ord -double compex|ca[3]|double|u.polynom.ca[3][2] +double complex|ca[3]|double|u.polynom.ca[3][2] double|a[3]|double|u.polynom.a[3] const char*|table|const char*|u.linterp.table gd_bit_t|bitnum|gd_bit_t|u.bit.bitnum gd_bit_t|numbits|gd_bit_t|u.bit.numbits gd_shift_t|shift|gd_shift_t|u.phase.shift -double compex|cdividend|double|u.recip.cdividend[2] +double complex|cdividend|double|u.recip.cdividend[2] double|dividend|double|u.recip.dividend gd_type_t|const_type|gd_type_t|u.scalar.const_type size_t|array_len|size_t|u.scalar.array_len .TE .PP -In the case of complex valued data in the C89 API, the first element of the two -element array is the real part of the complex number, and the second element is -the imaginary part. +In the case of complex valued data in the C89 API, the first element of the +two-element array is the real part of the complex number, and the second +element is the imaginary part. .SH SEE ALSO .BR dirfile (5), Modified: trunk/getdata/man/gd_field_list_by_type.3 =================================================================== --- trunk/getdata/man/gd_field_list_by_type.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_field_list_by_type.3 2011-04-08 23:51:57 UTC (rev 576) @@ -13,7 +13,7 @@ .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" -.TH gd_field_list_by_type 3 "3 Novmeber 2010" "Version 0.7.0" "GETDATA" +.TH gd_field_list_by_type 3 "3 November 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_field_list_by_type \(em retrieve a list of fields in a dirfile .SH SYNOPSIS Modified: trunk/getdata/man/gd_get_carray_slice.3 =================================================================== --- trunk/getdata/man/gd_get_carray_slice.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_get_carray_slice.3 2011-04-08 23:51:57 UTC (rev 576) @@ -13,7 +13,7 @@ .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" -.TH gd_get_carray_slice 3 "3 Novmeber 2010" "Version 0.7.0" "GETDATA" +.TH gd_get_carray_slice 3 "3 November 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_get_carray gd_get_carray_slice \(em retrieve CARRAY data from a dirfile database @@ -168,7 +168,7 @@ .I return_type was specified. .TP -.B GE_E_BOUNDS +.B GD_E_BOUNDS A request for data beyond the end of the field was made. .TP .B GD_E_INTERNAL_ERROR Modified: trunk/getdata/man/gd_get_constant.3 =================================================================== --- trunk/getdata/man/gd_get_constant.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_get_constant.3 2011-04-08 23:51:57 UTC (rev 576) @@ -13,7 +13,7 @@ .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" -.TH gd_get_constant 3 "3 Novmeber 2010" "Version 0.7.0" "GETDATA" +.TH gd_get_constant 3 "3 November 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_get_constant \(em retrieve a scalar constant from a dirfile database .SH SYNOPSIS Modified: trunk/getdata/man/gd_include.3 =================================================================== --- trunk/getdata/man/gd_include.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_include.3 2011-04-08 23:51:57 UTC (rev 576) @@ -190,16 +190,16 @@ successfully performed on the dirfile. Once the library has determined the encoding scheme for the first time, it remembers it for subsequent calls. .TP -.B GD_BZIP2_ENDODED +.B GD_BZIP2_ENCODED Specifies that raw data files are compressed using the Burrows-Wheeler block sorting text compression algorithm and Huffman coding, as implemented in the bzip2 format. .TP -.B GD_GZIP_ENDODED +.B GD_GZIP_ENCODED Specifies that raw data files are compressed using Lempel-Ziv coding (LZ77) as implemented in the gzip format. .TP -.B GD_LZMA_ENDODED +.B GD_LZMA_ENCODED Specifies that raw data files are compressed using the Lempel-Ziv Markov Chain Algorithm (LZMA) as implemented in the xz container format. .TP Modified: trunk/getdata/man/gd_put_carray_slice.3 =================================================================== --- trunk/getdata/man/gd_put_carray_slice.3 2011-04-06 03:32:59 UTC (rev 575) +++ trunk/getdata/man/gd_put_carray_slice.3 2011-04-08 23:51:57 UTC (rev 576) @@ -13,7 +13,7 @@ .\" Texts. A copy of the license is included in the `COPYING.DOC' file .\" as part of this distribution. .\" -.TH gd_put_carray_slice 3 "4 Novmeber 2010" "Version 0.7.0" "GETDATA" +.TH gd_put_carray_slice 3 "3 November 2010" "Version 0.7.0" "GETDATA" .SH NAME gd_put_carray gd_put_carray_slice \(em write CARRAY data to a dirfile database .SH SYNOPSIS @@ -50,7 +50,7 @@ The .BR gd_put_carray () function behaves similarly, except the whole scalar array is written. These -interface cannot write to field represetations. +interface cannot write to field representations. The argument .I data_in @@ -162,7 +162,7 @@ .I data_type was specified. .TP -.B GE_E_BOUNDS +.B GD_E_BOUNDS A request for data beyond the end of the field was made. .TP .B GD_E_INTERNAL_ERROR This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-06 03:33:05
|
Revision: 575 http://getdata.svn.sourceforge.net/getdata/?rev=575&view=rev Author: ketiltrout Date: 2011-04-06 03:32:59 +0000 (Wed, 06 Apr 2011) Log Message: ----------- Probably shouldn't hardcode that. Modified Paths: -------------- trunk/getdata/src/Makefile.am trunk/getdata/test/Makefile.am Modified: trunk/getdata/src/Makefile.am =================================================================== --- trunk/getdata/src/Makefile.am 2011-04-06 03:29:37 UTC (rev 574) +++ trunk/getdata/src/Makefile.am 2011-04-06 03:32:59 UTC (rev 575) @@ -91,7 +91,7 @@ endif pkgconfigdir = @libdir@/pkgconfig -AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR) -Wdeclaration-after-statement +AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR) AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS) BUILT_SOURCES = getdata.h Modified: trunk/getdata/test/Makefile.am =================================================================== --- trunk/getdata/test/Makefile.am 2011-04-06 03:29:37 UTC (rev 574) +++ trunk/getdata/test/Makefile.am 2011-04-06 03:32:59 UTC (rev 575) @@ -38,7 +38,7 @@ endif LDADD=../src/libgetdata.la -INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src -Wdeclaration-after-statement +INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src EXTRA_DIST=test.h This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-06 03:29:52
|
Revision: 574 http://getdata.svn.sourceforge.net/getdata/?rev=574&view=rev Author: ketiltrout Date: 2011-04-06 03:29:37 +0000 (Wed, 06 Apr 2011) Log Message: ----------- Swiss army chainsawing of the test suite: * remove __TEST__ * delete any existing dirfile before starting the test * a few other minor details Also, accept cdividend = NULL in gd_alter_crecip89(). Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/cmake/test/CMakeLists.txt trunk/getdata/src/Makefile.am trunk/getdata/src/mod.c trunk/getdata/test/Makefile.am trunk/getdata/test/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_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_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_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_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_sort.c trunk/getdata/test/add_spec.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_type.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_const.c trunk/getdata/test/alter_cpolynom.c trunk/getdata/test/alter_crecip.c trunk/getdata/test/alter_crecip89.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_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_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_mspec.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_meta.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/bof.c trunk/getdata/test/bof_lincom.c trunk/getdata/test/bof_phase.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.c trunk/getdata/test/close_bad.c trunk/getdata/test/close_discard.c trunk/getdata/test/close_null.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_array_meta.c trunk/getdata/test/cvlist_invalid.c trunk/getdata/test/cvlist_meta.c trunk/getdata/test/cvlist_meta_invalid.c trunk/getdata/test/del.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_deref.c trunk/getdata/test/del_const_force.c trunk/getdata/test/del_data.c trunk/getdata/test/del_derived.c trunk/getdata/test/del_derived_force.c trunk/getdata/test/del_meta.c trunk/getdata/test/del_meta_force.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_null.c trunk/getdata/test/dfes_phase.c trunk/getdata/test/dfes_raw.c trunk/getdata/test/dfes_recip.c trunk/getdata/test/dfes_zero.c trunk/getdata/test/encode_alter.c trunk/getdata/test/encode_get.c trunk/getdata/test/encode_move.c trunk/getdata/test/endian_alter.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_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_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_raw_scalar_code.c trunk/getdata/test/entry_raw_scalar_type.c trunk/getdata/test/entry_scalar_repr.c trunk/getdata/test/entry_type.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/error.c trunk/getdata/test/error_error.c trunk/getdata/test/error_short.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/flist_invalid.c trunk/getdata/test/flist_meta.c trunk/getdata/test/flist_meta_invalid.c trunk/getdata/test/flist_type.c trunk/getdata/test/flist_type_invalid.c trunk/getdata/test/flist_type_meta.c trunk/getdata/test/flist_type_meta_invalid.c trunk/getdata/test/flush.c trunk/getdata/test/flush_all.c trunk/getdata/test/flush_bad_code.c trunk/getdata/test/flush_invalid.c trunk/getdata/test/flush_meta.c trunk/getdata/test/flush_spec.c trunk/getdata/test/foffs_alter.c trunk/getdata/test/foffs_get.c trunk/getdata/test/foffs_move.c trunk/getdata/test/fragment_index.c trunk/getdata/test/fragment_name.c trunk/getdata/test/fragment_name_oor.c trunk/getdata/test/get64.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_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_divide.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_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_lincom3.c trunk/getdata/test/get_lincom_noin.c trunk/getdata/test/get_lincom_non.c trunk/getdata/test/get_linterp.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_multiply.c trunk/getdata/test/get_multiply_noin.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_polynom.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_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_zero.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_get.c trunk/getdata/test/gzip_get_get.c trunk/getdata/test/gzip_move_from.c trunk/getdata/test/gzip_nframes.c trunk/getdata/test/gzip_put.c trunk/getdata/test/header_complex.c trunk/getdata/test/include.c trunk/getdata/test/include_accmode.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_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_syntax.c trunk/getdata/test/index.c trunk/getdata/test/index_domain.c trunk/getdata/test/index_range.c trunk/getdata/test/legacy_get.c trunk/getdata/test/legacy_get_put.c trunk/getdata/test/legacy_get_rofs.c trunk/getdata/test/legacy_nframes.c trunk/getdata/test/legacy_nonexistent.c trunk/getdata/test/legacy_put.c trunk/getdata/test/legacy_spf.c trunk/getdata/test/lzma_get.c trunk/getdata/test/lzma_nframes.c trunk/getdata/test/madd.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_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_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/move.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_index.c trunk/getdata/test/move_meta.c trunk/getdata/test/move_protect.c trunk/getdata/test/move_subdir.c trunk/getdata/test/name.c trunk/getdata/test/name_move.c trunk/getdata/test/nfields.c trunk/getdata/test/nfields_invalid.c trunk/getdata/test/nfields_type.c trunk/getdata/test/nfields_type_invalid.c trunk/getdata/test/nfragments.c trunk/getdata/test/nframes.c trunk/getdata/test/nframes64.c trunk/getdata/test/nframes_empty.c trunk/getdata/test/nframes_invalid.c trunk/getdata/test/nframes_off64.c trunk/getdata/test/nframes_spf.c trunk/getdata/test/nmeta.c trunk/getdata/test/nmeta_invalid.c trunk/getdata/test/nmeta_parent.c trunk/getdata/test/nmeta_type.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_del.c trunk/getdata/test/nmeta_vectors_invalid.c trunk/getdata/test/nmeta_vectors_parent.c trunk/getdata/test/nvectors.c trunk/getdata/test/nvectors_invalid.c trunk/getdata/test/open.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_eaccess.c trunk/getdata/test/open_nonexistent.c trunk/getdata/test/open_notdirfile.c trunk/getdata/test/parent.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_ncols.c trunk/getdata/test/parse_divide.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_include.c trunk/getdata/test/parse_include_absolute.c trunk/getdata/test/parse_include_absrel.c trunk/getdata/test/parse_include_nonexistent.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_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_implicit.c trunk/getdata/test/parse_meta_implicit2.c trunk/getdata/test/parse_meta_index.c trunk/getdata/test/parse_meta_index2.c trunk/getdata/test/parse_meta_parent.c trunk/getdata/test/parse_meta_raw.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_include.c trunk/getdata/test/parse_version_permissive.c trunk/getdata/test/parse_version_slash.c trunk/getdata/test/parse_whitespace.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_slice.c trunk/getdata/test/put_char.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_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_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_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/ref.c trunk/getdata/test/ref_none.c trunk/getdata/test/ref_two.c trunk/getdata/test/repr_a.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/slim_get.c trunk/getdata/test/slim_nframes.c trunk/getdata/test/slim_put.c trunk/getdata/test/spf.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_recip.c trunk/getdata/test/spf_recurse.c trunk/getdata/test/svlist.c trunk/getdata/test/svlist_invalid.c trunk/getdata/test/svlist_meta.c trunk/getdata/test/svlist_meta_invalid.c trunk/getdata/test/test.h trunk/getdata/test/trunc.c trunk/getdata/test/trunc_rdonly.c trunk/getdata/test/trunc_rofs.c trunk/getdata/test/unclude.c trunk/getdata/test/unclude_del.c trunk/getdata/test/unclude_move.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/vlist.c trunk/getdata/test/vlist_invalid.c trunk/getdata/test/vlist_meta.c trunk/getdata/test/vlist_meta_invalid.c trunk/getdata/test/xz_get.c trunk/getdata/test/xz_nframes.c Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/ChangeLog 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,13 @@ +2011-04-06 D. V. Wiebe <ge...@ke...> svn:574 + * test/: Remove the unnecessarily baroque (rococo?) __TEST__ macro. + Add rmdirfile() to the top of each test before creating the test + dirfile. Shift definitions to the top of the files for C89 compliance. + A few other minor fixes. + * cmake/test/CMakeLists.txt: Remove __TEST__ (and __TEST_SLASH__?); + no longer needed. + + * src/mod.c (gd_alter_crecip89): Accept cdividend=NULL for cdividend=(0,0) + 2011-04-05 D. V. Wiebe <ge...@ke...> svn:573 Merge in updates from 0.7 branch, r512 and subsequent: Modified: trunk/getdata/cmake/test/CMakeLists.txt =================================================================== --- trunk/getdata/cmake/test/CMakeLists.txt 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/cmake/test/CMakeLists.txt 2011-04-06 03:29:37 UTC (rev 574) @@ -47,11 +47,6 @@ endforeach() -set(__TEST__ "-D__TEST__=\"${CMAKE_BINARY_DIR}/\"") -set(__TEST_SLASH__ "-D__TEST_SLASH__=\"${CMAKE_BINARY_DIR}/\"") -STRING(REGEX REPLACE "/" "\\\\\\\\" __TEST__ ${__TEST__}) -add_definitions(${__TEST__} ${__TEST_SLASH__}) - #set(gd_sources ${GD_DIR}/test/parse_include_relabs.c) foreach(_test ${gd_sources}) Modified: trunk/getdata/src/Makefile.am =================================================================== --- trunk/getdata/src/Makefile.am 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/src/Makefile.am 2011-04-06 03:29:37 UTC (rev 574) @@ -91,7 +91,7 @@ endif pkgconfigdir = @libdir@/pkgconfig -AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR) +AM_CFLAGS = ${WALL} ${WEXTRA} $(DGETDATA_MODULEDIR) -Wdeclaration-after-statement AM_CPPFLAGS = $(LTDLINCL) $(EXTERNAL_CPPFLAGS) BUILT_SOURCES = getdata.h Modified: trunk/getdata/src/mod.c =================================================================== --- trunk/getdata/src/mod.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/src/mod.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1183,8 +1183,9 @@ int ret; gd_entry_t N; - dtrace("%p, \"%s\", \"%s\", [%g, %g]", D, field_code, in_field, cdividend[0], - cdividend[1]); + dtrace("%p, \"%s\", \"%s\", [%g, %g]", D, field_code, in_field, + (cdividend == NULL) ? 0 : cdividend[0], + (cdividend == NULL) ? 0 : cdividend[1]); if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); @@ -1194,8 +1195,13 @@ N.field_type = GD_RECIP_ENTRY; N.in_fields[0] = (char *)in_field; - N.scalar[0] = (cdividend[0] == 0 && cdividend[1] == 0) ? (char *)"" : NULL; - _gd_a2c(N.EN(recip,cdividend), cdividend); + if (cdividend == NULL) { + N.scalar[0] = ""; + _gd_l2c(N.EN(recip,cdividend), 0, 0); + } else { + N.scalar[0] = (cdividend[0] == 0 && cdividend[1] == 0) ? (char *)"" : NULL; + _gd_a2c(N.EN(recip,cdividend), cdividend); + } N.scalar_ind[0] = 0; N.comp_scal = 1; N.e = NULL; Modified: trunk/getdata/test/Makefile.am =================================================================== --- trunk/getdata/test/Makefile.am 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/Makefile.am 2011-04-06 03:29:37 UTC (rev 574) @@ -38,7 +38,7 @@ endif LDADD=../src/libgetdata.la -INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src -D__TEST__=\"$@\" +INCLUDES=${WALL} $(WEXTRA) -I$(top_srcdir)/src -Wdeclaration-after-statement EXTRA_DIST=test.h @@ -333,11 +333,11 @@ # clean up after the tests check-local: check-TESTS - $(MAKE) getdata-clean-dirs + $(MAKE) getdata-clean-dir -getdata-clean-dirs: - rm -rvf *odirfile +getdata-clean-dir: + rm -rvf dirfile clean-local: - $(MAKE) getdata-clean-dirs + $(MAKE) getdata-clean-dir rm -rf *~ Modified: trunk/getdata/test/add.c =================================================================== --- trunk/getdata/test/add.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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" @@ -11,21 +31,14 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; - const char* data = __TEST__ "dirfile/data"; + 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; - // remove stuff of failed tests - unlink(data); - unlink(format); - rmdir(filedir); -#ifdef _WIN32 - system("rmdir /q/s "__TEST__"dirfile"); -#endif - printf(format); + rmdirfile(); E.field = "data"; E.field_type = GD_RAW_ENTRY; E.fragment_index = 0; Modified: trunk/getdata/test/add_bit.c =================================================================== --- trunk/getdata/test/add_bit.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_bit.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 BIT field */ #include "test.h" @@ -11,12 +31,15 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + gd_add_bit(D, "new", "input", 1, 1, 0); error = gd_error(D); Modified: trunk/getdata/test/add_bit_bitnum.c =================================================================== --- trunk/getdata/test/add_bit_bitnum.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_bit_bitnum.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 BIT field */ #include "test.h" @@ -10,11 +30,14 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, n, r = 0; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT); + gd_add_bit(D, "new", "input", -1, 1, 0); error = gd_error(D); Modified: trunk/getdata/test/add_bit_bitsize.c =================================================================== --- trunk/getdata/test/add_bit_bitsize.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_bit_bitsize.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 BIT field */ #include "test.h" @@ -10,11 +30,14 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, n, r = 0; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT); + gd_add_bit(D, "new", "input", 1, 99, 0); error = gd_error(D); Modified: trunk/getdata/test/add_bit_invalid.c =================================================================== --- trunk/getdata/test/add_bit_invalid.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_bit_invalid.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 + */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" @@ -9,10 +29,13 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - DIRFILE* D = gd_open(filedir, GD_RDONLY); + const char *filedir = "dirfile"; int error, r = 0; + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDONLY); + gd_add_bit(D, "new", "input", 1, 1, 0); error = gd_error(D); gd_close(D); Modified: trunk/getdata/test/add_bit_numbits.c =================================================================== --- trunk/getdata/test/add_bit_numbits.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_bit_numbits.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 BIT field */ #include "test.h" @@ -10,11 +30,14 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, n, r = 0; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT); + gd_add_bit(D, "new", "input", 1, 0, 0); error = gd_error(D); Modified: trunk/getdata/test/add_carray.c =================================================================== --- trunk/getdata/test/add_carray.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_carray.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* Copyright (C) 2010-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 + */ #include "test.h" #include <inttypes.h> @@ -11,15 +31,18 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; uint8_t val[] = {3, 4, 5, 6, 7}; uint8_t data[5]; int n, error; int r = 0; gd_entry_t e; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + gd_add_carray(D, "data", GD_UINT8, 5, GD_UINT8, &val, 0); error = gd_error(D); Modified: trunk/getdata/test/add_clincom.c =================================================================== --- trunk/getdata/test/add_clincom.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_clincom.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 + */ /* Add a complex LINCOM field */ #include "test.h" @@ -12,11 +32,10 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; - - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); - const char* in_fields[2] = {"in1", "in2"}; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + DIRFILE *D; + const char *in_fields[2] = {"in1", "in2"}; #ifdef GD_NO_C99_API const double m[4] = {1, 3.3, 0.3, 18.3}; const double b[4] = {2, 3.8, 2.1, 9.8}; @@ -27,6 +46,9 @@ int error, r = 0; gd_entry_t e; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + gd_add_clincom(D, "new", 2, in_fields, m, b, 0); error = gd_error(D); Modified: trunk/getdata/test/add_code.c =================================================================== --- trunk/getdata/test/add_code.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_code.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 with invalid characters */ #include "test.h" @@ -10,8 +30,8 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, n, r = 0; gd_entry_t E; DIRFILE *D; Modified: trunk/getdata/test/add_const.c =================================================================== --- trunk/getdata/test/add_const.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_const.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 CONST field */ #include "test.h" @@ -12,13 +32,15 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; uint8_t val = 3; int error, r = 0; gd_entry_t e; + DIRFILE *D; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_const(D, "data", GD_UINT8, GD_UINT8, &val, 0); error = gd_error(D); Modified: trunk/getdata/test/add_cpolynom.c =================================================================== --- trunk/getdata/test/add_cpolynom.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_cpolynom.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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 + */ /* Add a complex POLYNOM field */ #include "test.h" @@ -12,19 +32,21 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int r = 0; int error, j; gd_entry_t e; - - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + DIRFILE *D; #ifdef GD_NO_C99_API const double a[8] = {1, 29.03, 0.3, 12.34, 0.5, 99.55, 1.8, 45.32}; #else const double complex a[4] = {1 + _Complex_I * 29.03, 0.3 + _Complex_I * 12.34, 0.5 + _Complex_I * 99.55, 1.8 + _Complex_I * 45.32}; #endif + + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_cpolynom(D, "new", 3, "in", a, 0); error = gd_error(D); Modified: trunk/getdata/test/add_crecip.c =================================================================== --- trunk/getdata/test/add_crecip.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_crecip.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* Copyright (C) 2010-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 + */ #include "test.h" #include <stdlib.h> @@ -10,8 +30,8 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, r = 0; #ifdef GD_NO_C99_API const double cdividend[2] = {33.3, 44.4}; @@ -19,8 +39,11 @@ const double complex cdividend = 33.3 + _Complex_I * 44.4; #endif gd_entry_t e; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + gd_add_crecip(D, "new", "in", cdividend, 0); error = gd_error(D); Modified: trunk/getdata/test/add_crecip89.c =================================================================== --- trunk/getdata/test/add_crecip89.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_crecip89.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* Copyright (C) 2010-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 + */ #define GD_C89_API #include "test.h" @@ -11,13 +31,15 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; double dividend[2] = {33.3, 44.4}; + DIRFILE *D; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); gd_add_crecip(D, "new", "in", dividend, 0); error = gd_error(D); Modified: trunk/getdata/test/add_divide.c =================================================================== --- trunk/getdata/test/add_divide.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_divide.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* Copyright (C) 2010-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 + */ #include "test.h" #include <stdlib.h> @@ -10,12 +30,15 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; int error, r = 0; gd_entry_t e; - DIRFILE* D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + DIRFILE *D; + rmdirfile(); + D = gd_open(filedir, GD_RDWR | GD_CREAT | GD_VERBOSE); + gd_add_divide(D, "new", "in1", "in2", 0); error = gd_error(D); Modified: trunk/getdata/test/add_divide_invalid.c =================================================================== --- trunk/getdata/test/add_divide_invalid.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_divide_invalid.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* Copyright (C) 2010-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 + */ /* Getting data from an invalid dirfile should fail cleanly */ #include "test.h" @@ -9,10 +29,12 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; + const char *filedir = "dirfile"; int error, r = 0; + DIRFILE *D; - DIRFILE* D = gd_open(filedir, GD_RDONLY); + rmdirfile(); + D = gd_open(filedir, GD_RDONLY); gd_add_multiply(D, "new", "in1", "in2", 0); error = gd_error(D); gd_close(D); Modified: trunk/getdata/test/add_duplicate.c =================================================================== --- trunk/getdata/test/add_duplicate.c 2011-04-05 23:05:37 UTC (rev 573) +++ trunk/getdata/test/add_duplicate.c 2011-04-06 03:29:37 UTC (rev 574) @@ -1,3 +1,23 @@ +/* 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" @@ -10,9 +30,9 @@ int main(void) { - const char* filedir = __TEST__ "dirfile"; - const char* format = __TEST__ "dirfile/format"; - const char* format_data = "data RAW UINT8 8\n"; + const char *filedir = "dirfile"; + const char *format = "dirfile/format"; + const char *format_data = "data RAW UINT8 8\n"; int r = 0; int fd, error, n; gd_entry_t E; @@ -24,6 +44,7 @@ E.EN(raw,spf) = 2; E.EN(raw,data_type) = GD_UINT8; + rmdirfile(); mkdir(filedir, 0777); fd = open(format, O_CREAT | O_EXCL ... [truncated message content] |
From: <ket...@us...> - 2011-04-05 23:05:47
|
Revision: 573 http://getdata.svn.sourceforge.net/getdata/?rev=573&view=rev Author: ketiltrout Date: 2011-04-05 23:05:37 +0000 (Tue, 05 Apr 2011) Log Message: ----------- Merge changes from the 0.7 branch. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/INSTALL trunk/getdata/Makefile.am trunk/getdata/NEWS trunk/getdata/RELEASE_NOTES.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/f77/test/gdcopn.f trunk/getdata/bindings/idl/Makefile.am trunk/getdata/bindings/idl/package/configure.ac trunk/getdata/bindings/python/pydirfile.c trunk/getdata/cmake/CMakeLists.txt trunk/getdata/cmake/test/CMakeLists.txt trunk/getdata/configure.ac trunk/getdata/m4/encoding.m4 trunk/getdata/m4/python.m4 trunk/getdata/m4/version.m4 trunk/getdata/man/Makefile.am trunk/getdata/man/gd_add.3 trunk/getdata/man/gd_add_bit.3 trunk/getdata/man/gd_add_spec.3 trunk/getdata/man/gd_alter_bit.3 trunk/getdata/man/gd_alter_entry.3 trunk/getdata/man/gd_alter_protection.3 trunk/getdata/man/gd_alter_spec.3 trunk/getdata/man/gd_bof.3 trunk/getdata/man/gd_carray_len.3 trunk/getdata/man/gd_carrays.3 trunk/getdata/man/gd_cbopen.3 trunk/getdata/man/gd_close.3 trunk/getdata/man/gd_constants.3 trunk/getdata/man/gd_delete.3 trunk/getdata/man/gd_dirfile_standards.3 trunk/getdata/man/gd_dirfilename.3 trunk/getdata/man/gd_encoding.3 trunk/getdata/man/gd_endianness.3 trunk/getdata/man/gd_entry.3 trunk/getdata/man/gd_entry_type.3 trunk/getdata/man/gd_eof.3 trunk/getdata/man/gd_field_list.3 trunk/getdata/man/gd_field_list_by_type.3 trunk/getdata/man/gd_flush.3 trunk/getdata/man/gd_fragment_index.3 trunk/getdata/man/gd_fragmentname.3 trunk/getdata/man/gd_framenum_subset.3 trunk/getdata/man/gd_frameoffset.3 trunk/getdata/man/gd_get_carray_slice.3 trunk/getdata/man/gd_get_constant.3 trunk/getdata/man/gd_get_string.3 trunk/getdata/man/gd_getdata.3 trunk/getdata/man/gd_include.3 trunk/getdata/man/gd_madd_bit.3 trunk/getdata/man/gd_mcarrays.3 trunk/getdata/man/gd_mconstants.3 trunk/getdata/man/gd_metaflush.3 trunk/getdata/man/gd_mfield_list.3 trunk/getdata/man/gd_mfield_list_by_type.3 trunk/getdata/man/gd_move.3 trunk/getdata/man/gd_mstrings.3 trunk/getdata/man/gd_mvector_list.3 trunk/getdata/man/gd_native_type.3 trunk/getdata/man/gd_nfields.3 trunk/getdata/man/gd_nfields_by_type.3 trunk/getdata/man/gd_nfragments.3 trunk/getdata/man/gd_nframes.3 trunk/getdata/man/gd_nmfields.3 trunk/getdata/man/gd_nmfields_by_type.3 trunk/getdata/man/gd_nmvectors.3 trunk/getdata/man/gd_nvectors.3 trunk/getdata/man/gd_parent_fragment.3 trunk/getdata/man/gd_protection.3 trunk/getdata/man/gd_put_carray_slice.3 trunk/getdata/man/gd_put_constant.3 trunk/getdata/man/gd_put_string.3 trunk/getdata/man/gd_putdata.3 trunk/getdata/man/gd_raw_filename.3 trunk/getdata/man/gd_reference.3 trunk/getdata/man/gd_rename.3 trunk/getdata/man/gd_rewrite_fragment.3 trunk/getdata/man/gd_spf.3 trunk/getdata/man/gd_strings.3 trunk/getdata/man/gd_uninclude.3 trunk/getdata/man/gd_validate.3 trunk/getdata/man/gd_vector_list.3 trunk/getdata/src/add.c trunk/getdata/src/common.c trunk/getdata/src/encoding.c trunk/getdata/src/entry.c trunk/getdata/src/flush.c trunk/getdata/src/getdata.h.in trunk/getdata/src/include.c trunk/getdata/src/internal.h trunk/getdata/src/legacy.c trunk/getdata/src/mod.c trunk/getdata/src/move.c trunk/getdata/src/msvc/inttypes.h trunk/getdata/src/name.c trunk/getdata/src/parse.c trunk/getdata/src/raw.c trunk/getdata/test/Makefile.am trunk/getdata/test/alter_raw_type.c trunk/getdata/test/entry_phase.c trunk/getdata/test/get_ss.c trunk/getdata/test/move_data_enc_ar.c trunk/getdata/test/move_data_endian.c trunk/getdata/test/move_subdir.c trunk/getdata/test/test.h trunk/getdata/util/dirfile2ascii.c Added Paths: ----------- trunk/getdata/README.win trunk/getdata/cmake/FindGetData.cmake trunk/getdata/test/add_raw_include.c trunk/getdata/test/alter_crecip_zero.c trunk/getdata/test/alter_recip_zero.c trunk/getdata/test/parse_include_absolute.c trunk/getdata/test/parse_include_absrel.c trunk/getdata/test/parse_include_relabs.c trunk/getdata/test/parse_include_relrel.c Property Changed: ---------------- trunk/getdata/ trunk/getdata/NEWS trunk/getdata/bindings/idl/ trunk/getdata/bindings/perl/ trunk/getdata/bindings/perl/test/ trunk/getdata/cmake/ trunk/getdata/cmake/bindings/ trunk/getdata/cmake/bindings/cxx/ trunk/getdata/cmake/src/ trunk/getdata/man/ trunk/getdata/src/ trunk/getdata/src/parse.c trunk/getdata/test/ Property changes on: trunk/getdata ___________________________________________________________________ Modified: svn:ignore - Makefile Makefile.in aclocal.m4 autom4te.cache config.log config.guess config.status config.sub configure depcomp getdata-*.tar.gz getdata-*.tar.bz2 getdata-*.sig idl_getdata-*.tar.gz idl_getdata-*.tar.bz2 idl_getdata-*.sig install-sh libtool ltmain.sh missing *.swp libltdl README.txt config.lt compile + Makefile Makefile.in aclocal.m4 autom4te.cache config.log config.guess config.status config.sub configure depcomp getdata_win-*.zip getdata_win-*.sig getdata-*.tar.gz getdata-*.tar.bz2 getdata-*.sig idl_getdata-*.tar.gz idl_getdata-*.tar.bz2 idl_getdata-*.sig install-sh libtool ltmain.sh missing *.swp libltdl README.txt config.lt compile Modified: svn:mergeinfo - /branches/getdata-0.4:217-227 /branches/getdata-arm:355-413 /branches/getdata-osx:400-402 + /branches/getdata-0.4:217-227 /branches/getdata-0.7:513-566 /branches/getdata-arm:355-413 /branches/getdata-osx:400-402 Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/ChangeLog 2011-04-05 23:05:37 UTC (rev 573) @@ -1,3 +1,82 @@ +2011-04-05 D. V. Wiebe <ge...@ke...> svn:573 + Merge in updates from 0.7 branch, r512 and subsequent: + + * test/alter_crecip_zero.c test/alter_recip_zero.c: Added. + * src/mod.c (_GD_Change): If [c]dividend is zero, don't change it, per + documentation. + + * src/encoding.c (_GD_MissingFramework): Properly compute the module path. + + * src/flush.c (_GD_FieldSpec): For Standards Version >= 8, use new-style + metafield syntax. + + * src/entry.c (gd_raw_filename): Clear dirfile error on entry. + + * test/move_data_enc_ar.c test/entry_phase.c test/get_ss.c + test/alter_raw_type.c: Actually fail on error. + + * m4/version.m4 configure.ac: Fix library soversion defines. + + * m4/python.m4: Use the BSD `jot' if the Linux/Plan 9 `seq' is not found. + Also, look for python2.7. Added --with-python-module-dir. + + * src/add.c (_GD_Add): strdup ref_name when propagating upwards to prevent + double-free when _GD_FreeD() is called. + * test/add_raw_include.c: Added. + + * src/include.c (gd_include): If GD_CREAT is specified, but no encoding, + inherit encoding from parent. + + * test/test.h: Explicitly use long long format types in the checks. Write + paths properly under WIN32/WIN64. + + * src/legacy.c (GetFormat): Fix memset call. + + * src/common.c (_GD_GetLine): Remove unused first_char. + + * src/raw.c (_GD_RawSeek): nread is a ssize_t. + + * bindings/python/pydirfile.c (gdpy_dirfile_putcarray): Remove unused ns. + + * bindings/f77/test/big_test.f bindings/f77/test/big_test95.f90 + bindings/f77/test/gdcopn.f bindings/f77/getdata.f90.in: Explicity specify + constant kinds to stop the ridiculous complaints from Fedora's gfortran. + + * bindings/idl/Makefile.am: Don't needlessly rebuild sublist.c. + + * src/getdata.h.in: Replace #undefs with @DEFINE_...@ tokens. Define + gd_off64_t instead of polluting the namespace. Remove MSCRT specal casing + for the gd_*int*_t types. + * configure.ac: Update for changes to getdata.h.in. Run getdata.h.in + through config.status twice, first as an AC_CONFIG_FILE to replace all the + @DEFINE...@s, second as an AC_CONFIG_HEADER as a NOP, just to get the change + check. + * cmake/CMakeLists.txt: Add DEFINE_... variables. + + * configure.ac: Check for _strtoi64() and _strtoui64() + * src/internal.h: Use MSCRT's _strto[u]i64 for strto[u]ll when found. + * cmake/CMakeLists.txt: Add -DHAVE__STRTOI64 -DHAVE__STRTOUI64 + + * test/parse_include_absrel.c test/parse_include_relabs.c + test/parse_include_absolute.c: Free cwd. + + * configure.ac: check for "slimdata" in addition to "slim", which is what + the binary is called under Fedora. + * m4/encoding.m4 (GD_CHECK_ENCODING): Handle multiple binary names in $5 and + $6. + + * src/parse.c (_GD_ParseFieldSpec): Fix GD_E_FORMAT_DUPLICATE error data. + + * src/internal.h: Define S_ISREG and S_ISDIR if missing. + + * test/parse_include_absolute.c test/parse_include_absrel.c + test/parse_include_relabs.c test/parse_include_relrel.c: Added. + + * src/include.c (_GD_Include): Handle absolute paths in /INCLUDE directives. + The sname now contains D->name when appropriate. + * src/add.c (_GD_Add) src/parse.c (_GD_ParseRaw) src/move.c (gd_move): Fix + computation of filebase for new sname. + 2011-03-25 D. V. Wiebe <ge...@ke...> svn:566 * src/perl.m4: Added. * configure.ac: Perl tests. @@ -80,7 +159,7 @@ * src/internal.h: Conditionalise inclusion of non-ANSI unistd.h and stdint.h. Various _MSC_VER specific code. Also, define gd_stat64 and gd_stat64_t to - plausibly useful things by default.o + plausibly useful things by default. * src/getdata.h.in: Remove unistd.h. Add math.h and some _MSC_VER specific code. (There are still unresolved MSVC issues with this file.) @@ -777,7 +856,7 @@ * src/flimits.c (gd_get_eof gd_get_eof64 _GD_GetEOF): Renamed. Proper INDEX handling added. - * src/foffs.c src/flimits.c src/nsamples.c: fofds.c and nsamples.c merged + * src/foffs.c src/flimits.c src/nsamples.c: foffs.c and nsamples.c merged and renamed flimits.c. 2010-06-30 D. V. Wiebe <ge...@ke...> svn:425 svn:426 Modified: trunk/getdata/INSTALL =================================================================== --- trunk/getdata/INSTALL 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/INSTALL 2011-04-05 23:05:37 UTC (rev 573) @@ -40,8 +40,12 @@ The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You need `configure.ac' if you want to change it or regenerate `configure' using a newer version -of `autoconf'. +of `autoconf'. +To create the configure script, and the rest of the build environment +which are not part of a plain checkout from sourceforge, execute: + autoreconf -vifs + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type Modified: trunk/getdata/Makefile.am =================================================================== --- trunk/getdata/Makefile.am 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/Makefile.am 2011-04-05 23:05:37 UTC (rev 573) @@ -34,24 +34,25 @@ %.sig: % gpg -abo $@ $< -DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" +DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \ + --with-python-module-dir="$$dc_install_base/python" # idl-only package -idl_$(distdir).tar.bz2 idl_$(distdir).tar.gz: idldist - idldist: $(DISTFILES) - rm -rf idl_getdata - mkdir idl_getdata - mkdir idl_getdata/m4 - mkdir idl_getdata/src - cp bindings/idl/package/* idl_getdata - cp -r bindings/idl/Makefile.am bindings/idl/makedlm.sh.in \ - bindings/idl/getdata.c bindings/idl/test idl_getdata/src - cp -r bindings/make_parameters.c idl_getdata - cp -r m4/idl.m4 m4/compiler.m4 m4/ax_compare_version.m4 m4/version.m4 \ - idl_getdata/m4 - cp -r doc/README.idl COPYING AUTHORS ChangeLog INSTALL NEWS idl_getdata - ( cd idl_getdata && \ + rm -rf svn_export + svn export . svn_export + ( cd svn_export && \ + mkdir idl_getdata && \ + mkdir idl_getdata/m4 && \ + mkdir idl_getdata/src && \ + cp bindings/idl/package/* idl_getdata && \ + cp -r bindings/idl/Makefile.am bindings/idl/makedlm.sh.in \ + bindings/idl/getdata.c bindings/idl/test idl_getdata/src && \ + cp -r bindings/make_parameters.c idl_getdata && \ + cp -r m4/idl.m4 m4/compiler.m4 m4/ax_compare_version.m4 m4/version.m4 \ + idl_getdata/m4 && \ + cp -r doc/README.idl COPYING AUTHORS ChangeLog INSTALL NEWS idl_getdata && \ + ( cd idl_getdata && \ aclocal -I m4 && \ libtoolize && \ autoconf && \ @@ -59,19 +60,51 @@ automake --add-missing --force-missing && \ ./configure && \ make dist && \ - cp idl_${distdir}* .. \ + cp idl_${distdir}* ../.. \ + ) ) + rm -rf svn_export + +idldistcheck: idl_$(distdir).tar.gz + tar -zxvf $< + cd idl_$(distdir) && ./configure && make dist && make distcheck + rm -rf idl_$(distdir) + +# windows source package +windist: $(DISTFILES) + rm -rf crlf_export + cd man && $(MAKE) htmlman + svn --native-eol CRLF export . crlf_export + ( cd crlf_export && \ + mkdir $(distdir) && \ + mkdir $(distdir)/bindings && \ + mkdir $(distdir)/doc && \ + mkdir $(distdir)/man && \ + cp ../man/*[35].html $(distdir)/man && \ + cp -r bindings/cxx $(distdir)/bindings && \ + cp -r cmake src test $(distdir) && \ + $(SED) cmake/CMakeLists.txt \ + -e 's/-DPACKAGE_VERSION=\\".*\\"/-DPACKAGE_VERSION=\\"$(PACKAGE_VERSION)\\"/' \ + > $(distdir)/cmake/CMakeLists.txt && \ + cp -r doc/README.cxx doc/unclean_database_recovery.txt $(distdir)/doc && \ + cp AUTHORS COPYING COPYING.DOC ChangeLog NEWS TODO $(distdir) && \ + cp README.win $(distdir)/README && \ + rm -f $(distdir)/*/Makefile.am $(distdir)/*/*/Makefile.am && \ + zip -rq getdata_win-$(PACKAGE_VERSION).zip $(distdir) && \ + cp getdata_win*.zip .. \ ) - rm -rf idl_getdata + rm -rf crlf_export +# package lists +PACKAGES=$(distdir).tar.gz $(distdir).tar.bz2 idl_$(distdir).tar.gz \ + idl_$(distdir).tar.bz2 getdata_win-$(PACKAGE_VERSION).zip +SIGS=$(addsuffix .sig,$(PACKAGES)) + # release stuff README.txt: NEWS RELEASE_NOTES.in cp -f RELEASE_NOTES.in $@ head -n `grep -nm 1 '^|' NEWS | awk 'BEGIN {FS=":"} {print $$1-1}'` NEWS >> $@ -dist-post: $(distdir).tar.gz.sig $(distdir).tar.bz2.sig \ - idl_$(distdir).tar.gz.sig idl_$(distdir).tar.bz2.sig +dist-post: $(SIGS) -dist-push: $(distdir).tar.gz.sig $(distdir).tar.bz2.sig \ - $(distdir).tar.gz $(distdir).tar.bz2 idl_$(distdir).tar.gz.sig \ - idl_$(distdir).tar.bz2.sig README.txt +dist-push: $(PACKAGES) $(SIGS) README.txt rsync -avP -e ssh $^ $(SFUSER),ge...@fr...:/home/frs/project/g/ge/getdata/getdata/$(PACKAGE_VERSION)/ Modified: trunk/getdata/NEWS =================================================================== --- trunk/getdata/NEWS 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/NEWS 2011-04-05 23:05:37 UTC (rev 573) @@ -1,3 +1,48 @@ +New in version 0.7.3: + + Library Changes + + * BUG FIX: Passing a zero dividend to alter_crecip() and alter_recip() now + results in the dividend not changing, per documentation. + * BUG FIX: GetData wasn't properly computing the module directory, causing + encodings using external modules to fail with GD_E_UNSUPPORTED. + * BUG FIX: Metafield records are now properly stored in the format file for + Standards Version 8. + * BUG FIX: gd_raw_filename() wasn't clearing the Dirfile error before + operation, resulting in it failing erroneously in certain situations. + + Utilities Changes: + + * BUG FIX: A potential segmentation fault has been patched in dirfile2ascii. + +|==============================================================================| + +New in version 0.7.2: + + Library Changes + + * If built with modules, the plugin shared objects will now be installed in + a separate directory (by default "${libdir}/getdata", but see the + --with-module-dir option in ./configure). + * BUG FIX: When using modules, a missing plugin no longer results in a lock up + the second time an attempt is made to find it. + * BUG FIX: GetData now properly processes /INCLUDE directives with absolute + paths, as the documentation insists it should. + * BUG FIX: gd_add()ing the first raw field in a dirfile to a subfragment no + longer results in memory corruption when calling gd_close(). + + API Changes + + * If called with GD_CREAT but no encoding specified, gd_include() now will + duplicate the encoding of the parent fragment (if any). + + Miscellaneous + + * The python module install dir can now be changed by passing + --with-python-module-dir to configure. + +|==============================================================================| + New in version 0.7.1: Library Changes Property changes on: trunk/getdata/NEWS ___________________________________________________________________ Modified: svn:mergeinfo - /branches/getdata-0.4/NEWS:217-227 /branches/getdata-0.6/NEWS:369-391 /branches/getdata-arm/NEWS:355-413 /branches/getdata-osx/NEWS:400-402 + /branches/getdata-0.4/NEWS:217-227 /branches/getdata-0.6/NEWS:369-391 /branches/getdata-0.7/NEWS:513-566 /branches/getdata-arm/NEWS:355-413 /branches/getdata-osx/NEWS:400-402 Copied: trunk/getdata/README.win (from rev 566, branches/getdata-0.7/README.win) =================================================================== --- trunk/getdata/README.win (rev 0) +++ trunk/getdata/README.win 2011-04-05 23:05:37 UTC (rev 573) @@ -0,0 +1,176 @@ +THE GETDATA PROJECT +=================== + +The GetData Project is the reference implementation of the Dirfile Standards. +The Dirfile database format is designed to provide a fast, simple format for +storing and reading binary time-ordered data. The Dirfile Standards are +described in detail in three Unix manual pages distributed with this package: +dirfile(5), dirfile-format(5) and dirfile-encoding(5), which may be read before +installation by running: + + $ man man/dirfile.5 + $ man man/dirfile-format.5 + $ man man/dirfile-encoding.5 + +from the top GetData Project directory (the directory containing this README +file). After installation, they can be read with the standard man command: + + $ man dirfile + $ man dirfile-format + $ man dirfile-encoding + +More information on the GetData Project and the Dirfile database format may be +found on the World Wide Web: + + http://getdata.sourceforge.net/ + + +WARRANTY AND REDISTRIBUTION +=========================== + +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 in a file called `COPYING'; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + +CONTENTS +======== + +This package provides: + * the Dirfile Standards documents (three Unix manual pages in HTML) + * the C GetData library (libgetdata) including HTMLised Unix manual pages + * bindings to the library from C++ (libgetdata++) + +Documentation for the various bindings, if present, can be found in files +named `README.<language>' in the doc/ directory. The C interface is described +in this document and the associated man pages. + +A full list of features new to this release of GetData may be found in the +file called `NEWS'. + +This package only provides a subset of the functionality of the full GetData +source code release, and is designed to be built on Microsoft Windows using +Microsoft Corporation's Visual C++ compiler, or else the open source MinGW +compiler. Notably missing in this package are bindings for Fortran, Python, +and the Interactive Data Language, the binary utilities (checkdirfile and +dirfile2ascii), support for external data encodings (compressed dirfiles), +and the C Library's C99 and Legacy APIs. + +The full GetData source code release, which cannot be built (easily) by Visual +C++ (but can be built using MinGW, if the associated MSys shell is used) is +available from the World Wide Web; for details see: + + http://getdata.sourceforge.net/ + + + +DIRFILE STANDARDS VERSION 8 +=========================== + +The 0.7.0 release of the GetData Library (October 2010), was released in +conjunction with a new version of the Dirfile Standards, known as Standards +Version 8. + +Standards Version 8 introduces the following: + * Two new field types: DIVIDE, the quotient of two input vector fields, + and RECIP, the reciprocal of a vector field. + * Support for middle-endian ARM double-precision floating point data. + * Furthermore, several deprecated features have been removed. The old single + character type names are no longer accepted, and directives now require an + initial forward slash. (NB: these features are only removed from Standards + Version 8; GetData, which understands all Standards Versions, still can work + with these features.) + +This is the first update to the Dirfile Standards since Standards Version 7 +(October 2009). A full history of the Dirfile Standards can be found in the +dirfile-format(5) man page. + + +BUILDING THE LIBRARY +==================== + +This package may be built using Kitware's CMake build system. Consult the CMake +documentation for generic instructions on using CMake. A brief summary follows. +This package supports building GetData using either Microsoft's Visual C++ compiler +or else the free MinGW compiler, both which produce native Win32 binaries. + +Best practice is to build out of source. Call CMake in the build folder and +point it to the 'cmake' folder within the GetData source. For instance, +to create a project file for Microsoft Visual Studio 10 execute: + + cmake -G"Visual Studio 10" ..\getdata-0.7\cmake + +Then build the project as usual. + +The GetData test suit could be ebabled by setting the GD_TEST variable: + + cmake . -DGD_TEST=1 + +In Visual Studio run the test by building the 'RUN_TESTS'. Using mingw +or nmake run the tests by calling ctest. + +The install path could be set via the variable CMAKE_INSTALL_PREFIX. +By default it installs to <build-dir>/INSTALLED. + +The file cmake/FindGetData.cmake could be used in projects managed by +CMake and which have to search for a GetData installation. + + +PREREQUISITES +============= + +The only library required to build GetData is the C Standard Library. Several +other external will be used if found by ./configure to provide support for +various data encodings (typically compression schemes). These are: + +- the slim compression library by Joseph Fowler; +- the zlib library by Jean-loup Gailly and Mark Adler; +- the bzip2 compression library by Julian Seward; and, +- the lzma library, part of the XZ Utils suite by Lasse Collin, Ville Koskinen, + and Igor Pavlov. + +If these libraries are not found by configure, GetData will lack support for +the associated encoding scheme and fail gracefully if encountering dirfiles so +encoded. + + +USING THE LIBRARY +================= + +To use the library in C programs, the header file getdata.h should be included. + +The various small programs in the `util' subdirectory of the package provide +examples of use. + +The checkdirfile utility was designed to report syntax errors in the format +file(s) of the large, complex dirfiles used in the analysis of the BLAST +experiment data. This utility will report all syntax errors it find in the +supplied dirfile, plus any problems in the metadata itself. + +Bindings exist for using the GetData library in C++. Documentation for these +bindings is present in the README.cxx file in the `doc' subdirectory. + +Bindings to the GetData library from Fortran, Python, and the Interactive +Data Language have also been written, but not ported to Microsoft Visual C++. +If you are interested in these bindings, see the full GetData source release. + + +AUTHOR +====== + +The Dirfile Standards and the GetData library were conceived and written by +C. B. Netterfield <net...@as...>. + +Since Standards Version 3 (January 2006), the Dirfile Standards and GetData +have been maintained by D. V. Wiebe <dv...@ke...>. + +A full list of contributors is given in the file called `AUTHORS'. Modified: trunk/getdata/RELEASE_NOTES.in =================================================================== --- trunk/getdata/RELEASE_NOTES.in 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/RELEASE_NOTES.in 2011-04-05 23:05:37 UTC (rev 573) @@ -1,18 +1,40 @@ -GetData 0.7.1 is known to compile and pass the test suite on the following systems (including C++ and Fortran bindings): +GetData 0.7.2 is known to compile and pass the test suite on the following +systems (including C++ and Fortran bindings): Linux: -* x86 and x86_64, using gcc 4.5 or icc 10.1, under Slackware, Fedora, Ubuntu, CentOS -* armv5tej, using gcc 3.3 under Debian +* x86, x86_64, PPC, S390, SPARC, ARM under (variously) Debian, Slackware, + Fedora, Ubuntu, CentOS MacOS X: * x86 and x86_64, using Xcode 3.2/gcc 4.2, under MacOS X Snow Leopard Cygwin: * x86_64, using gcc 4.3 Win32: * x86_64, using mingw/gcc 4.5, under MSys +* X86_64, using MSVC 10 -The Python bindings have been tested with Python 2.4 and Python 2.6. +The Python bindings have been tested with Python 2.4 through Python 2.7. -The IDL bindings have been tested with IDL 6.0, IDL 7.1 and IDL 8.0. +The IDL bindings have been tested with IDL 6.0, IDL 7.1. --------------------------------------------------------------------------------------------------------- +------------------------------------------------------------------------------- +Three packages are available: +* getdata-0.7.2.tar.bz2/.gz: the full source code to the library, with + bindings. This package uses the GNU autotools build system, and is + designed for POSIX systems (UNIX, Linux, BSD, MacOS X, Cygwin, MSys, &c.) +* getdata_win-0.7.2.zip: a reduced source code package, with the CMake build + system designed to be built on Microsoft Windows, either using the free + MinGW compiler, or else Microsoft's Visual C++ compiler. (The full + source package above can also be built using MinGW, if the MSys shell is + used to run the build system.) Currently, the only bindings provided by + this package are the C++ bindings, and the package lacks support for + compressed dirfiles, the Legacy API, and a few other features. This + build is used in native Microsoft Windows builds of kst2. +* idl_getdata-0.7.2.tar.bz2/.gz: the Interactive Data Language (IDL) bindings, + packaged separately with an autotools build system, designed to be built + against an already installed version of GetData. Due to licensing + restrictions, pre-built packages rarely come with these bindings, and + this package allows end-users to add support for IDL without having to + recompile the whole GetData package. + +------------------------------------------------------------------------------- Modified: trunk/getdata/bindings/f77/getdata.f90.in =================================================================== --- trunk/getdata/bindings/f77/getdata.f90.in 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/f77/getdata.f90.in 2011-04-05 23:05:37 UTC (rev 573) @@ -2090,7 +2090,7 @@ character (len=*), intent(in) :: field_name integer*1, dimension(array_len) :: zero - zero = 0. + zero = 0 call gdadca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, & array_len, GD_INT8, zero, fragment_index) @@ -2101,7 +2101,7 @@ character (len=*), intent(in) :: field_name, parent integer*1, dimension(array_len) :: zero - zero = 0. + zero = 0 call gdmdca(dirfile, TRIM(parent), LEN_TRIM(parent), TRIM(field_name), & LEN_TRIM(field_name), const_type, array_len, GD_INT8, zero) @@ -2112,7 +2112,7 @@ character (len=*), intent(in) :: field_name integer*1, dimension(array_len) :: zero - zero = 0. + zero = 0 call gdalca(dirfile, TRIM(field_name), LEN_TRIM(field_name), const_type, & array_len) Modified: trunk/getdata/bindings/f77/test/big_test.f =================================================================== --- trunk/getdata/bindings/f77/test/big_test.f 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/f77/test/big_test.f 2011-04-05 23:05:37 UTC (rev 573) @@ -25,7 +25,7 @@ C F77 bindings. Procedures not tested include: GDCOPN GDMFLS GDFLSH C GDDSCD GDCLBK GDCLOS (although this last one is used) - PROGRAM GETTST + PROGRAM BIGTST INCLUDE "getdata.f" CHARACTER*12 fildir @@ -46,6 +46,7 @@ CHARACTER*20 str INTEGER*1 c(8) INTEGER*1 datdat(80) + INTEGER*1 k INTEGER i INTEGER d INTEGER e @@ -62,14 +63,24 @@ CALL SYSTEM ( 'rm -rf ' // fildir ) CALL SYSTEM ( 'mkdir ' // fildir ) - DO 10 i = 1, 80 - datdat(i) = i + DO 10 k = 1, 80 + datdat(k) = k 10 CONTINUE - fields =(/ 'INDEX ', 'bit ', 'carray ', 'const ', 'data ', - +'div ', 'lincom ', 'linterp', 'mult ', 'phase ', 'polynom', - +'recip ', 'sbit ', 'string ', ' ', ' ', ' ', - +' ', ' ', ' ', ' ' /) + fields(1) = 'INDEX ' + fields(2) = 'bit ' + fields(3) = 'carray ' + fields(4) = 'const ' + fields(5) = 'data ' + fields(6) = 'div ' + fields(7) = 'lincom ' + fields(8) = 'linterp' + fields(9) = 'mult ' + fields(10) = 'phase ' + fields(11) = 'polynom' + fields(12) = 'recip ' + fields(13) = 'sbit ' + fields(14) = 'string ' C Write the test dirfile OPEN(1, FILE=frmat, STATUS='NEW') @@ -304,7 +315,14 @@ ENDIF C 13: GDPUTD check - c = (/ 13, 14, 15, 16, 17, 18, 19, 20 /) + c(1) = 13 + c(2) = 14 + c(3) = 15 + c(4) = 16 + c(5) = 17 + c(6) = 18 + c(7) = 19 + c(8) = 20 CALL GDPUTD(n, d, 'data', 4, 5, 1, 0, 4, GD_I8, c) CALL GDEROR(e, d) @@ -416,7 +434,12 @@ WRITE(*, 2008) 17, 6, fields(3) ENDIF - q = (/ 1.1, 2.2, 2.2, 3.3, 5.5, 5.5 /) + q(1) = 1.1 + q(2) = 2.2 + q(3) = 2.2 + q(4) = 3.3 + q(5) = 5.5 + q(6) = 5.5 DO 170 i=1,6 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -509,7 +532,12 @@ WRITE(*, 2008) 19, 4, fn ENDIF - q = (/ 1.1, 2.2, 2.2, 3.3, 5.5, 5.5 /) + q(1) = 1.1 + q(2) = 2.2 + q(3) = 2.2 + q(4) = 3.3 + q(5) = 5.5 + q(6) = 5.5 DO 190 i=1,6 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -831,7 +859,12 @@ WRITE(*, 2008) 29, 7, fields(2) ENDIF - q = (/ 9.9, 8.8, 7.7, 6.6, 5.5, 5.5 /) + q(1) = 9.9 + q(2) = 8.8 + q(3) = 7.7 + q(4) = 6.6 + q(5) = 5.5 + q(6) = 5.5 DO 290 i=1,4 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -939,7 +972,13 @@ WRITE(*, 2008) 31, 4, fn ENDIF - q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /) + q(1) = 3d3 + q(2) = 4d4 + q(3) = 5d5 + q(4) = 6d6 + q(5) = 5.5d0 + q(6) = 5.5d0 + DO 310 i=1,4 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -1346,10 +1385,27 @@ ENDIF C 45: GDVECN check - fields =(/ 'INDEX ', 'bit ', 'data ', 'div ', 'lincom ', - +'linterp', 'mult ', 'new1 ', 'new10 ', 'new2 ', 'new3 ', - +'new4 ', 'new5 ', 'new6 ', 'new7 ', 'new8 ', 'new9 ', - +'phase ', 'polynom', 'recip ', 'sbit ' /) + fields(1) = 'INDEX ' + fields(2) = 'bit ' + fields(3) = 'data ' + fields(4) = 'div ' + fields(5) = 'lincom ' + fields(6) = 'linterp' + fields(7) = 'mult ' + fields(8) = 'new1 ' + fields(9) = 'new10 ' + fields(10) = 'new2 ' + fields(11) = 'new3 ' + fields(12) = 'new4 ' + fields(13) = 'new5 ' + fields(14) = 'new6 ' + fields(15) = 'new7 ' + fields(16) = 'new8 ' + fields(17) = 'new9 ' + fields(18) = 'phase ' + fields(19) = 'polynom' + fields(20) = 'recip ' + fields(21) = 'sbit ' DO 450 i = 1, n l = flen CALL GDVECN(fn, l, d, i) @@ -1416,7 +1472,12 @@ WRITE(*, 2008) 46, 7, fields(2) ENDIF - q = (/ 9.9, 8.8, 7.7, 6.6, 5.5, 5.5 /) + q(1) = 9.9 + q(2) = 8.8 + q(3) = 7.7 + q(4) = 6.6 + q(5) = 5.5 + q(6) = 5.5 DO 460 i=1,4 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -1524,7 +1585,12 @@ WRITE(*, 2008) 48, 4, fn ENDIF - q = (/ 3d3, 4d4, 5d5, 6d6, 5.5d0, 5.5d0 /) + q(1) = 3d3 + q(2) = 4d4 + q(3) = 5d5 + q(4) = 6d6 + q(5) = 5.5d0 + q(6) = 5.5d0 DO 480 i=1,4 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -1948,7 +2014,7 @@ WRITE(*, 2006) 61, 1, e ENDIF - CALL GDGTCO(d, 'const', 11, GD_F32, fl) + CALL GDGTCO(d, 'const', 5, GD_F32, fl) CALL GDEROR(e, d) IF (e .NE. GD_EOK) THEN @@ -2041,10 +2107,16 @@ ENDIF C 66: GDMVEN check - fields =(/'mlut ', 'mnew1 ', 'mnew2 ', 'mnew3 ', 'mnew5 ', - +'mnew6 ', 'mnew7 ', 'mnew8 ', 'mnew9 ', 'mnew10', ' ', - +' ', ' ', ' ', ' ', ' ', ' ', - +' ', ' ', ' ', ' '/) + fields(1) = 'mlut ' + fields(2) = 'mnew1 ' + fields(3) = 'mnew2 ' + fields(4) = 'mnew3 ' + fields(5) = 'mnew5 ' + fields(6) = 'mnew6 ' + fields(7) = 'mnew7 ' + fields(8) = 'mnew8 ' + fields(9) = 'mnew9 ' + fields(10) = 'mnew10' DO 660 i = 1, n l = flen CALL GDMVEN(fn, l, d, "data", 4, i) @@ -2148,7 +2220,12 @@ WRITE(*, 2008) 68, 8, fields(3) ENDIF - q = (/ 9.9d-1, 7.8d0, 1.1d1, 2.2d-2, 1.96d0, 0d0 /) + q(1) = 9.9d-1 + q(2) = 7.8d0 + q(3) = 1.1d1 + q(4) = 2.2d-2 + q(5) = 1.96d0 + q(6) = 0d0 DO 680 i=1,6 IF (abs(p(i) - q(i)) .gt. 0.001) THEN ne = ne + 1 @@ -2256,9 +2333,8 @@ WRITE(*, 2008) 70, 4, fn ENDIF - q = (/ 3d0, 4d0, 5d0, 6d0, 7d0, 0d0 /) DO 700 i=1,5 - IF (abs(p(i) - q(i)) .gt. 0.001) THEN + IF (abs(p(i) - 2d0 - i) .gt. 0.001) THEN ne = ne + 1 WRITE(*, 2010) i, 70, p(i) ENDIF @@ -3635,7 +3711,12 @@ 1590 CONTINUE C 168: GDPTCA check - p = (/ 9.6, 8.5, 7.4, 6.3, 5.2, 4.1 /) + p(1) = 9.6 + p(2) = 8.5 + p(3) = 7.4 + p(4) = 6.3 + p(5) = 5.2 + p(6) = 4.1 CALL GDPTCA(d, 'carray', 6, GD_F64, p) CALL GDEROR(e, d) @@ -3660,7 +3741,12 @@ 1680 CONTINUE C 169: GDGCAS check - p = (/ 5.5, 5.6, 5.7, 5.8, 5.9, 6.0 /) + p(1) = 5.5 + p(2) = 5.6 + p(3) = 5.7 + p(4) = 5.8 + p(5) = 5.9 + p(6) = 6.0 CALL GDPCAS(d, 'carray', 6, 3, 2, GD_F64, p) CALL GDEROR(e, d) @@ -3730,7 +3816,10 @@ ENDIF C 179: GDADCA check - p = (/ 1.2, 3.4, 5.6, 7.8, 0., 0. /) + p(1) = 1.2 + p(2) = 3.4 + p(3) = 5.6 + p(4) = 7.8 CALL GDADCA(d, 'new17', 5, GD_F64, 4, GD_F64, p, 0) CALL GDEROR(e, d) @@ -3778,7 +3867,10 @@ 1790 CONTINUE C 180: GDMDCA check - p = (/ 3.2, 5.4, 7.6, 9.8, 0., 0. /) + p(1) = 3.2 + p(2) = 5.4 + p(3) = 7.6 + p(4) = 9.8 CALL GDMDCA(d, 'data', 4, 'new17', 5, GD_F64, 4, GD_F64, p) CALL GDEROR(e, d) @@ -3877,19 +3969,19 @@ CALL EXIT(1) ENDIF - 2001 FORMAT('e[', i0, '] = ', i0) - 2002 FORMAT('n[', i0, '] = ', i0) - 2003 FORMAT('ne = ', i0) - 2004 FORMAT('c(', i0, ')[', i0, '] = ', i0) - 2005 FORMAT('fl[', i0, '] = ', f0.16) - 2006 FORMAT('e[', i0, ', ', i0, '] = ', i0) - 2007 FORMAT('n[', i0, ', ', i0, '] = ', i0) - 2008 FORMAT('fn(', i0, ')[', i0, '] = "', a, '"') - 2009 FORMAT('s[' i0, '] = "', a, '"') - 2010 FORMAT('p(', i0, ')[', i0, '] = ', d16.10) - 2011 FORMAT('p(', i0, ')[', i0, '] = ', d16.10, ';', d16.10) - 2012 FORMAT('d[', i0, '] = ', d16.10) - 2013 FORMAT('x[', i0, '] = ', d16.10, ';', d16.10) + 2001 FORMAT('e[', i3, '] = ', i4) + 2002 FORMAT('n[', i3, '] = ', i4) + 2003 FORMAT('ne = ', i8) + 2004 FORMAT('c(', i3, ')[', i3, '] = ', i2) + 2005 FORMAT('fl[', i3, '] = ', f0.16) + 2006 FORMAT('e[', i3, ', ', i3, '] = ', i4) + 2007 FORMAT('n[', i3, ', ', i3, '] = ', i4) + 2008 FORMAT('fn(', i3, ')[', i3, '] = "', a, '"') + 2009 FORMAT('s[', i3, '] = "', a, '"') + 2010 FORMAT('p(', i3, ')[', i3, '] = ', d16.10) + 2011 FORMAT('p(', i3, ')[', i3, '] = ', d16.10, ';', d16.10) + 2012 FORMAT('d[', i3, '] = ', d16.10) + 2013 FORMAT('x[', i3, '] = ', d16.10, ';', d16.10) STOP END Modified: trunk/getdata/bindings/f77/test/big_test95.f90 =================================================================== --- trunk/getdata/bindings/f77/test/big_test95.f90 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/f77/test/big_test95.f90 2011-04-05 23:05:37 UTC (rev 573) @@ -57,7 +57,7 @@ double complex, dimension(8) :: cc16 do i=1,80 - datadata(i) = i + datadata(i) = int(i,1) end do call system ( 'rm -rf ' // fildir ) @@ -552,7 +552,7 @@ end if ! 13: fgd_putdata_i1 check - ci1 = (/ 13, 14, 15, 16, 17, 18, 19, 20 /) + ci1 = (/ 13_1, 14_1, 15_1, 16_1, 17_1, 18_1, 19_1, 20_1 /) n = fgd_putdata_i1(d, 'data', 5, 1, 0, 4, ci1) e = fgd_error(d) @@ -577,7 +577,7 @@ end do ! 118: fgd_putdata_i2 check - ci2 = (/ 23, 24, 25, 26, 27, 28, 29, 30 /) + ci2 = (/ 23_2, 24_2, 25_2, 26_2, 27_2, 28_2, 29_2, 30_2 /) n = fgd_putdata_i2(d, 'data', 5, 1, 0, 4, ci2) e = fgd_error(d) @@ -4286,7 +4286,7 @@ end do ! 168: gd_put_carray - ci1 = (/ 11, 12, 13, 14, 15, 16, 0, 0 /) + ci1 = (/ 11_1, 12_1, 13_1, 14_1, 15_1, 16_1, 0_1, 0_1 /) call fgd_put_carray_i1(d, "carray", 0, 0, ci1) e = fgd_error(d) @@ -4311,7 +4311,7 @@ end do ! 169: gd_put_carray_slice (INT8) - ci1 = (/ 72, 73, 0, 0, 0, 0, 0, 0 /) + ci1 = (/ 72_1, 73_1, 0_1, 0_1, 0_1, 0_1, 0_1, 0_1 /) call fgd_put_carray_i1(d, "carray", 3, 2, ci1) e = fgd_error(d) @@ -4343,7 +4343,7 @@ end do ! 170: gd_put_carray_slice (INT16) - ci2 = (/ 173, 174, 0, 0, 0, 0, 0, 0 /) + ci2 = (/ 173_2, 174_2, 0_2, 0_2, 0_2, 0_2, 0_2, 0_2 /) call fgd_put_carray_i2(d, "carray", 3, 2, ci2) e = fgd_error(d) Modified: trunk/getdata/bindings/f77/test/gdcopn.f =================================================================== --- trunk/getdata/bindings/f77/test/gdcopn.f 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/f77/test/gdcopn.f 2011-04-05 23:05:37 UTC (rev 573) @@ -26,7 +26,7 @@ CHARACTER*9 frmdat2 PARAMETER (frmdat2 = 'bad line') INTEGER*1 datdat(80) - INTEGER i; + INTEGER*1 i; INTEGER d; INTEGER e; Property changes on: trunk/getdata/bindings/idl ___________________________________________________________________ Modified: svn:ignore - makedlm.sh constants.c sublist.c .deps idl_getdata.dlm Makefile Makefile.in + makedlm.sh constants.c sublist.c .deps idl_getdata.dlm Makefile Makefile.in stamp-h2 sublist.stamp sublist.c.in Modified: trunk/getdata/bindings/idl/Makefile.am =================================================================== --- trunk/getdata/bindings/idl/Makefile.am 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/idl/Makefile.am 2011-04-05 23:05:37 UTC (rev 573) @@ -45,12 +45,38 @@ idl_getdata_la_LDFLAGS = -module -avoid-version -export-symbols-regex IDL_Load \ -precious-files-regex 'idl_getdata\.dlm' $(IDL_LIBS) idl_getdata_la_LIBADD = $(GDIDL_GETDATA_LIBS) -idl_getdata_la_SOURCES = getdata.c ${DEBUG_C} -nodist_idl_getdata_la_SOURCES = constants.c sublist.c +idl_getdata_la_SOURCES = getdata.c +nodist_idl_getdata_la_SOURCES = constants.c sublist.c ${DEBUG_C} -sublist.c: getdata.c makedlm.sh +sublist.c.in: getdata.c makedlm.sh ${SHELL} ./makedlm.sh -c $< > $@ +sublist.c: sublist.stamp + @if test ! -f $@; then \ + rm -f $<; \ + $(MAKE) $<; \ + fi + +if HAVE_DIFF + +sublist.stamp: sublist.c.in + @if $(DIFF) sublist.c sublist.c.in >/dev/null 2>&1; then \ + echo "sublist.c is unchanged"; \ + else \ + rm -f sublist.c; \ + cp sublist.c.in sublist.c; \ + fi; \ + touch sublist.stamp + +else + +sublist.stamp: sublist.c.in + @rm -f sublist.c; \ + cp sublist.c.in sublist.c; \ + touch sublist.stamp + +endif + constants.c: ../make_parameters ../make_parameters i > $@ @@ -68,5 +94,5 @@ cp $< .libs clean-local: - rm -rf ${BUILT_SOURCES} *~ idl_getdata.dlm makedlm.sh + rm -rf ${BUILT_SOURCES} *~ idl_getdata.dlm makedlm.sh sublist.c.in sublist.stamp Modified: trunk/getdata/bindings/idl/package/configure.ac =================================================================== --- trunk/getdata/bindings/idl/package/configure.ac 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/idl/package/configure.ac 2011-04-05 23:05:37 UTC (rev 573) @@ -63,6 +63,7 @@ AC_PROG_LN_S AC_PROG_GREP AC_PROG_AWK +AC_CHECK_PROGS([DIFF], [diff], []) AC_PROG_SED echo echo "*** Checking C compiler characteristics" @@ -195,13 +196,14 @@ AC_CONFIG_FILES([src/test/Makefile]) dnl Automake conditionals -AM_CONDITIONAL(GETDATA_DEBUG, [test "x$enable_debug" == "xyes"]) +AM_CONDITIONAL(GETDATA_DEBUG, [false]) AM_CONDITIONAL(CC_WALL, [test "x$gd_cv_prog_cc_wall" == "xyes"]) AM_CONDITIONAL(INTEL_F77_COMPILER, [test "x$gd_cv_f77_compiler_intel" == "xyes"]) AM_CONDITIONAL(INTEL_FC_COMPILER, [test "x$gd_cv_fc_compiler_intel" == "xyes"]) AM_CONDITIONAL(LFS_TRANSITIONAL_API, [test "x$gd_cv_type_off64_t" = "xyes"]) AM_CONDITIONAL(TEST_IDL, [test "x$NO_DLOPEN_TESTS" = "x0"]) +AM_CONDITIONAL(HAVE_DIFF, [test "x$DIFF" != "x"]) AM_CONDITIONAL(GDIDL_EXTERNAL, [true]) dnl we do this here to avoid screwing up other tests Property changes on: trunk/getdata/bindings/perl ___________________________________________________________________ Added: svn:ignore + simple_funcs.xs Makefile.in GetData.pm GetData.c funclist.sed deps make_parameters.sed Makefile .deps .libs Property changes on: trunk/getdata/bindings/perl/test ___________________________________________________________________ Added: svn:ignore + Makefile.in Makefile Modified: trunk/getdata/bindings/python/pydirfile.c =================================================================== --- trunk/getdata/bindings/python/pydirfile.c 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/bindings/python/pydirfile.c 2011-04-05 23:05:37 UTC (rev 573) @@ -1597,7 +1597,6 @@ unsigned int start = 0, len; gd_type_t type = GD_UNKNOWN; PyObject* pyobj; - size_t ns; if (!PyArg_ParseTupleAndKeywords(args, keys, "sO|iI:pygetdata.dirfile.putdata", keywords, &field_code, &pyobj, @@ -1678,7 +1677,7 @@ } } - ns = gd_put_carray_slice(self->D, field_code, start, len, type, data); + gd_put_carray_slice(self->D, field_code, start, len, type, data); #ifdef USE_NUMPY if (have_ndarray) Property changes on: trunk/getdata/cmake ___________________________________________________________________ Added: svn:ignore + getdata.h CMakeCache.txt CMakeFiles cmake_install.cmake lib Makefile Modified: trunk/getdata/cmake/CMakeLists.txt =================================================================== --- trunk/getdata/cmake/CMakeLists.txt 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/cmake/CMakeLists.txt 2011-04-05 23:05:37 UTC (rev 573) @@ -25,16 +25,31 @@ #TODO add configure add_definitions( -DPACKAGE_NAME=\"GetData\" - -DPACKAGE_VERSION=\"0.7\" - -DPACKAGE_BUGREPORT=\"www\") + -DPACKAGE_VERSION=\"0.7.2\" + -DPACKAGE_BUGREPORT=\"get...@li...\") +## Substitutions needed to build getdata.h +# build in ANSI C mode +set(DEFINE_GD_NO_C99_API "#define GD_NO_C99_API") + +# kst2 doesn't need the legacy API +set(DEFINE_GD_LEGACY_API "/* #undef GD_LEGACY_API */") + +# MSVCRT integer types +set(DEFINE_gd_int16_t "#define gd_int16_t short int") +set(DEFINE_gd_uint16_t "#define gd_uint16_t unsigned short int") +set(DEFINE_gd_int64_t "#define gd_int64_t __int64") + + + if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS) add_definitions( -D__MSVCRT__ -D_USE_MATH_DEFINES -DHAVE_DIRENT_H + -DHAVE_DIRECT_H -DHAVE_LIBGEN_H -DSTDC_HEADERS -DHAVE_INTTYPES_H @@ -45,7 +60,7 @@ -DHAVE__COMMIT -DHAVE__STRTOI64 -DHAVE__STRTOUI64 - -DGD_NO_C99_API + -DHAVE__GETCWD ) set(CMAKE_DEBUG_POSTFIX d) @@ -70,11 +85,13 @@ -DHAVE_LIBGEN_H -DHAVE_STRTOLL -DHAVE_DIRENT_H + -DHAVE_DIRECT_H -DHAVE__COMMIT -DHAVE__STAT64 - -DHAVE_STRUCT___STAT64 -DHAVE__STRTOI64 -DHAVE__STRTOUI64 + -DHAVE_STRUCT___STAT64 + -DHAVE__GETCWD -DMKDIR_NO_MODE ) endif() Copied: trunk/getdata/cmake/FindGetData.cmake (from rev 566, branches/getdata-0.7/cmake/FindGetData.cmake) =================================================================== --- trunk/getdata/cmake/FindGetData.cmake (rev 0) +++ trunk/getdata/cmake/FindGetData.cmake 2011-04-05 23:05:37 UTC (rev 573) @@ -0,0 +1,85 @@ +# OSI-approved MIT License, http://www.opensource.org/licenses/mit-license +# +# Copyright (c) 2011 Peter Kümmel +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# + + +include(FindPkgConfig) + +pkg_check_modules(PKGGETDATA QUIET getdata>=0.6.0) +#message(STATUS "GD inc: ${PKGGETDATA_INCLUDEDIR}") +#message(STATUS "GD libs: ${PKGGETDATA_LIBRARIES}") + + +# Apple: install getdata with --prefix /opt/local + +# FIXME: GETDATA_INCLUDEDIR AND GETDATA_LIBRARIES are set by pkg_check_modules, but +# GETDATA_LIBRARY_C and GETDATA_LIBRARY_CPP are not. +# Ubuntu: maybe /usr/local/lib/pkgconfig/getdata.pc is not correct +#if(NOT PKGGETDATA_LIBRARIES) + set(PKGGETDATA_LIBRARIES getdata++ getdata) + if (UNIX) + SET(PKGGETDATA_LIBRARIES ${PKGGETDATA_LIBRARIES} m) + endif() +#endif() + + +set(GETDATA_INCLUDEDIR GETDATA_INCLUDEDIR-NOTFOUND CACHE STRING "" FORCE) +FIND_PATH(GETDATA_INCLUDEDIR getdata.h + HINTS + ENV GETDATA_DIR + PATH_SUFFIXES include/getdata include + PATHS ${kst_3rdparty_dir} ${GETDATA_INCLUDEDIR}) + +foreach(it ${PKGGETDATA_LIBRARIES}) + set(lib_release lib_release-NOTFOUND CACHE STRING "" FORCE) + FIND_LIBRARY(lib_release ${it} + HINTS ENV GETDATA_DIR PATH_SUFFIXES lib + PATHS ${kst_3rdparty_dir} ${PKGGETDATA_LIBRARY_DIRS}) + list(APPEND GETDATA_LIBRARIES_RELEASE ${lib_release}) + list(APPEND GETDATA_LIBRARIES_BOTH optimized ${lib_release}) + set(lib_debug lib_debug-NOTFOUND CACHE STRING "" FORCE) + FIND_LIBRARY(lib_debug ${it}d + HINTS ENV GETDATA_DIR PATH_SUFFIXES lib + PATHS ${kst_3rdparty_dir} ${PKGGETDATA_LIBRARY_DIRS}) + list(APPEND GETDATA_LIBRARIES_DEBUG ${lib_debug}) + list(APPEND GETDATA_LIBRARIES_BOTH debug ${lib_debug}) +endforeach() + +if(GETDATA_LIBRARIES_DEBUG AND GETDATA_LIBRARIES_RELEASE) + set(GETDATA_LIBRARIES ${GETDATA_LIBRARIES_BOTH}) +else() + set(GETDATA_LIBRARIES ${GETDATA_LIBRARIES_RELEASE}) +endif() + + +IF(GETDATA_INCLUDEDIR AND GETDATA_INCLUDEDIR) + SET(GETDATA_INCLUDE_DIR ${GETDATA_INCLUDEDIR}) + SET(getdata 1) + message(STATUS "Found GetData:") + message(STATUS " includes : ${GETDATA_INCLUDE_DIR}") + message(STATUS " libraries: ${GETDATA_LIBRARIES}") +ELSE() + MESSAGE(STATUS "Not found: Getdata, set GETDATA_DIR") +ENDIF() + + + Property changes on: trunk/getdata/cmake/bindings ___________________________________________________________________ Added: svn:ignore + CMakeFiles cmake_install.cmake Makefile Property changes on: trunk/getdata/cmake/bindings/cxx ___________________________________________________________________ Added: svn:ignore + CMakeFiles cmake_install.cmake Makefile Property changes on: trunk/getdata/cmake/src ___________________________________________________________________ Added: svn:ignore + CMakeFiles cmake_install.cmake Makefile Modified: trunk/getdata/cmake/test/CMakeLists.txt =================================================================== --- trunk/getdata/cmake/test/CMakeLists.txt 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/cmake/test/CMakeLists.txt 2011-04-05 23:05:37 UTC (rev 573) @@ -46,13 +46,14 @@ list(REMOVE_ITEM gd_sources ${GD_DIR}/test/${_item}.c) endforeach() -#set(gd_sources ${GD_DIR}/test/close.c ${GD_DIR}/test/alter_multiply.c) - set(__TEST__ "-D__TEST__=\"${CMAKE_BINARY_DIR}/\"") +set(__TEST_SLASH__ "-D__TEST_SLASH__=\"${CMAKE_BINARY_DIR}/\"") STRING(REGEX REPLACE "/" "\\\\\\\\" __TEST__ ${__TEST__}) -add_definitions(${__TEST__}) +add_definitions(${__TEST__} ${__TEST_SLASH__}) +#set(gd_sources ${GD_DIR}/test/parse_include_relabs.c) + foreach(_test ${gd_sources}) get_filename_component(testname ${_test} NAME_WE) set(testname test_${testname}) Modified: trunk/getdata/configure.ac =================================================================== --- trunk/getdata/configure.ac 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/configure.ac 2011-04-05 23:05:37 UTC (rev 573) @@ -39,8 +39,8 @@ dnl export version information from m4/version.m4 AC_SUBST(GETDATA_IFACE_VERSION, [getdata_iface_version]) -AC_SUBST(GETDATA_IMPL_REVISION, [getdata_iface_revision]) -AC_SUBST(GETDATA_IFACE_AGE, [getdata_iface_revision]) +AC_SUBST(GETDATA_IMPL_REVISION, [getdata_impl_revision]) +AC_SUBST(GETDATA_IFACE_AGE, [getdata_iface_age]) AC_SUBST(GETDATAXX_VERSION, [getdataxx_version]) AC_SUBST(FGETDATA_VERSION, [fgetdata_version]) AC_SUBST(F95GETDATA_VERSION, [f95getdata_version]) @@ -63,7 +63,7 @@ dnl Legacy API AC_ARG_ENABLE(legacy-api, AS_HELP_STRING([--disable-legacy-api], - [don't include the legacy API wrapper in the library]), + [don't include the legacy API wrapper in the library]), dnl' [ case "${enableval}" in no) include_legacy_api="no" ;; @@ -74,8 +74,11 @@ AC_MSG_RESULT([$include_legacy_api]) if test "x$include_legacy_api" != "xno"; then - AC_DEFINE([GD_LEGACY_API], [], [ This symbol is defined whenever the library contains the legacy API ]) + DEFINE_GD_LEGACY_API="#define GD_LEGACY_API" +else + DEFINE_GD_LEGACY_API="/* #undef GD_LEGACY_API */" fi +AC_SUBST([DEFINE_GD_LEGACY_API]) dnl debugging AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert], @@ -300,6 +303,7 @@ AC_PROG_GREP AC_PROG_AWK AC_PROG_SED +AC_CHECK_PROGS([DIFF], [diff], []) GD_MSYS_SHELL echo echo "*** Checking C compiler characteristics" @@ -316,9 +320,11 @@ fi fi if test "x$disable_c99" = "xyes"; then - AC_DEFINE([GD_NO_C99_API], [1], - [define to disable C99-specific code in the library source]) + DEFINE_GD_NO_C99_API="#define GD_NO_C99_API" +else + DEFINE_GD_NO_C99_API="/* #undef GD_NO_C99_API */" fi +AC_SUBST([DEFINE_GD_NO_C99_API]) AC_HEADER_STDC AM_PROG_AS @@ -368,30 +374,7 @@ BUILDCC=$CC AC_SUBST([BUILDCC]) fi -echo -echo "*** Checking C++ compiler characteristics" -echo -AC_PROG_CXX -AC_PROG_CXX_C_O -echo -echo "*** Checking Fortran 77 compiler characteristics" -echo -AC_PROG_F77 -AC_PROG_F77_C_O -echo -echo "*** Checking Fortran 90 compiler characteristics" -echo -AC_PROG_FC -AC_PROG_FC_C_O -dnl does $FC accept fortran code with .f90 extension? -AC_MSG_CHECKING([whether the Fortran 90 compiler works]) -AC_LANG_PUSH([Fortran]) -ac_ext="f90" -AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], -[AC_MSG_RESULT([yes])], -[AC_MSG_RESULT([no]); FC=;]) -AC_LANG_POP echo echo "*** Building libtool" echo @@ -481,7 +464,6 @@ dnl F77 stuff if test "x$make_f77bindings" != "xno"; then - AC_CHECK_PROGS([DIFF], [diff], []) AC_F77_WRAPPERS fi @@ -527,8 +509,9 @@ dnl functions AC_CHECK_FUNCS([_commit fchmod _fdopen fseeko fseeko64 fsync ftello ftello64 \ - getdelim gmtime_r _lseeki64 _mkdir mkstemp nan _open _read \ - _rmdir stat64 _stat64 strtoll strtoull _unlink _write]) + getcwd _getcwd getdelim gmtime_r _lseeki64 _mkdir mkstemp nan \ + _open _read _rmdir _snprintf stat64 _stat64 _strtoi64 strtoll \ + _strtoui64 strtoull _unlink _write]) if test "x$disable_c99" = "xno"; then AC_CHECK_FUNCS([cabs]) fi @@ -538,7 +521,7 @@ echo echo "*** Looking for additional header files" echo -AC_CHECK_HEADERS([fcntl.h libgen.h stdint.h unistd.h]) +AC_CHECK_HEADERS([direct.h fcntl.h libgen.h stdint.h unistd.h]) if test "x$disable_c99" = "xno"; then AC_CHECK_HEADERS([complex.h]) fi @@ -608,6 +591,16 @@ #endif ]) +GD_CHECK_LFS_TYPE([struct _stat64],[ +#ifdef STDC_HEADERS +#include <sys/types.h> +#include <sys/stat.h> +#endif +#ifdef HAVE_UNISTD_H +#include <unistd.h> +#endif +]) + GD_CHECK_LFS_TYPE([struct __stat64],[ #ifdef STDC_HEADERS #include <sys/types.h> @@ -680,12 +673,12 @@ gd_int64_t="long long int" fi -AC_DEFINE_UNQUOTED([_gd_int16_t], [$gd_int16_t], - [ Define to a signed 16-bit integer type ]) -AC_DEFINE_UNQUOTED([_gd_uint16_t], [$gd_uint16_t], - [ Define to an unsigned 16-bit integer type ]) -AC_DEFINE_UNQUOTED([_gd_int64_t], [$gd_int64_t], - [ Define to a signed 64-bit integer type ]) +DEFINE_gd_int16_t="#define gd_int16_t $gd_int16_t"; +DEFINE_gd_uint16_t="#define gd_uint16_t $gd_uint16_t"; +DEFINE_gd_int64_t="#define gd_int64_t $gd_int64_t"; +AC_SUBST([DEFINE_gd_int16_t]) +AC_SUBST([DEFINE_gd_uint16_t]) +AC_SUBST([DEFINE_gd_int64_t]) dnl python if test "x$make_pybindings" = "xyes"; then @@ -744,7 +737,7 @@ if test "x$DATE" == "xnot found"; then BUILD_DATE="Build date unspecified" else - BUILD_DATE=`date` + BUILD_DATE=`$DATE` fi AC_SUBST([BUILD_DATE]) fi @@ -773,7 +766,7 @@ dnl external encodings GD_CHECK_ENCODING([bzip2],[bz2],[BZ2_bzReadOpen],[bzlib.h],[bzip2],[bunzip2]) -GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h],[slim],[unslim],[]) +GD_CHECK_ENCODING([slim],[slim],[slimopen],[slimlib.h],[slim slimdata],[unslim],[]) GD_CHECK_ENCODING([gzip],[z],[gzopen],[zlib.h],[gzip],[gunzip],[]) GD_CHECK_ENCODING([lzma],[lzma],[lzma_auto_decoder],[lzma.h],[xz],[],[]) @@ -818,7 +811,10 @@ AC_CONFIG_FILES([man/gd_alter_endianness.3]) AC_CONFIG_FILES([man/gd_alter_frameoffset.3]) AC_CONFIG_FILES([src/Makefile]) -AC_CONFIG_HEADERS([src/getdata.h], [chmod a-w src/getdata.h]) +dnl This doubling allows us to build getdata.h as a normal AC_CONFIG_FILE, but use +dnl AC_CONFIG_HEADERS to check whether it has changed. +AC_CONFIG_FILES([src/getdata.ah:src/getdata.h.in]) +AC_CONFIG_HEADERS([src/getdata.h:src/getdata.ah], [chmod a-w src/getdata.h]) AC_CONFIG_FILES([src/getdata.pc]) AC_CONFIG_FILES([test/Makefile]) AC_CONFIG_FILES([util/Makefile]) Modified: trunk/getdata/m4/encoding.m4 =================================================================== --- trunk/getdata/m4/encoding.m4 2011-04-05 22:49:03 UTC (rev 572) +++ trunk/getdata/m4/encoding.m4 2011-04-05 23:05:37 UTC (rev 573) @@ -26,32 +26,33 @@ [ have_this_header= have_this_lib= +m4_define([gd_encoding], [$1]) AC_ARG_WITH([lib$2], AS_HELP_STRING([--with-lib$2=PREFIX], [use the lib$2 installed in PREFIX [autodetect]]), [ case "${withval}" in - no) use_$1="no" ;; - yes) use_$1="yes"; $1_prefix= ;; - *) use_$1="yes"; $1_prefix="${withval}" ;; + no) use_[]gd_encoding="no" ;; + yes) use_[]gd_encoding="yes"; gd_encoding[]_prefix= ;; + *) use_[]gd_encoding="yes"; gd_encoding[]_prefix="${withval}" ;; esac - ], [ use_$1="yes"; $1_prefix=; ]) + ], [ use_[]gd_encoding="yes"; gd_encoding[]_prefix=; ]) m4_divert_once([HELP_WITH], AS_HELP_STRING([--without-lib$2], [disable encodings supported by lib$2, even if the library is present])) echo -echo "*** Configuring $1 support" +echo "*** Configuring gd_encoding support" echo if test "x$no_extern" = "xyes"; then - use_$1="no"; + use_[]gd_encoding="no"; fi -if test "x$use_$1" = "xyes"; then +if test "x$use_[]gd_encoding" = "xyes"; then dnl search for library saved_ldflags=$LDFLAGS saved_libs=$LIBS - if test "x$[]$1_prefix" != "x"; then - LDFLAGS="$LDFLAGS -L$[]$1_prefix/lib" + if test "x$gd_encoding[]_prefix" != "x"; then + LDFLAGS="$LDFLAGS -L$gd_encoding[]_prefix/lib" fi AC_CHECK_LIB([$2],[$3],[have_this_lib=yes] AC_DEFINE(AS_TR_CPP([HAVE_LIB$2]), 1, @@ -61,69 +62,72 @@ dnl search for header saved_cppflags=$CPPFLAGS - if test "x$[]$1_prefix" != "x"; then - CPPFLAGS="$CPPFLAGS -I$[]$1_prefix/include" + if test "x$gd_encoding[]_prefix" != "x"; then + CPPFLAGS="$CPPFLAGS -I$gd_encoding[]_prefix/include" fi AC_CHECK_HEADERS([$4],[have_this_header=yes]) CPPFLAGS=$saved_cppflags fi dnl cleanup -AS_TR_CPP([$1_CPPFLAGS])= -AS_TR_CPP([$1_LDFLAGS])= +AS_TR_CPP(gd_encoding[_CPPFLAGS])= +AS_TR_CPP(gd_encoding[_LDFLAGS])= if test "x$have_this_header" = "xyes" -a "x$have_this_lib" = "xyes"; then - if test "x$[]$1_prefix" = "x"; then - AS_TR_CPP([$1_LDFLAGS])="-l$2" - AS_TR_CPP([$1_SEARCHPATH])="$PATH" + if test "x$gd_encoding[]_prefix" = "x"; then + AS_TR_CPP(gd_encoding[_LDFLAGS])="-l$2" + AS_TR_CPP(gd_encoding[_SEARCHPATH])="$PATH" else - AS_TR_CPP([$1_CPPFLAGS])="-I$[]$1_prefix/include" - AS_TR_CPP([$1_LDFLAGS])="-L$[]$1_prefix/lib -l$2" - AS_TR_CPP([$1_SEARCHPATH])="$[]$1_prefix/bin:$PATH" + AS_TR_CPP(gd_encoding[_CPPFLAGS])="-I$gd_encoding[]_prefix/include" + AS_TR_CPP(gd_encoding[_LDFLAGS])="-L$gd_encoding[]_prefix/lib -l$2" + AS_TR_CPP(gd_encoding[_SEARCHPATH])="$gd_encoding[]_prefix/bin:$PATH" fi - AC_DEFINE(AS_TR_CPP([USE_$1]), [], [ Define to enable $1 support ]) + AC_DEFINE(AS_TR_CPP([USE_]gd_encoding), [], [ Define to enable ]gd_encoding[ support ]) else - use_$1="no"; - AS_TR_CPP([$1_SEARCHPATH])="$PATH" + use_[]gd_encoding="no"; + AS_TR_CPP(gd_encoding[_SEARCHPATH])="$PATH" fi -AC_SUBST(AS_TR_CPP([$1_CPPFLAGS])) -AC_SUBST(AS_TR_CPP([$1_LDFLAGS])) +AC_SUBST(AS_TR_CPP(gd_encoding[_CPPFLAGS])) +AC_SUBST(AS_TR_CPP(gd_encoding[_LDFLAGS])) dnl executables needed for tests -AC_PATH_PROGS([path_$5], [$5], [not found], [$AS_TR_CPP([$1_SEARCHPATH])]) +m4_define(gd_progname, regexp([$5 ], [^\([^ ]*\) ], [\1])) +AC_PATH_PROGS([path_]gd_progname, [$5], [not found], [$AS_TR_CPP(gd_encoding[_SEARCHPATH])]) -if test "x$path_$5" != "xnot found"; then - AC_DEFINE_UNQUOTED(AS_TR_CPP([$5]), ["$path_$5"], - [ Define to the full path to the `$5' binary ]) +if test "x$path_[]gd_progname" != "xnot found"; then + AC_DEFINE_UNQUOTED(AS_TR_CPP... [truncated message content] |
From: <ket...@us...> - 2011-04-05 22:49:09
|
Revision: 572 http://getdata.svn.sourceforge.net/getdata/?rev=572&view=rev Author: ketiltrout Date: 2011-04-05 22:49:03 +0000 (Tue, 05 Apr 2011) Log Message: ----------- Tag getdata-0.7.3 Added Paths: ----------- tags/getdata-0.7.3/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-05 22:31:51
|
Revision: 571 http://getdata.svn.sourceforge.net/getdata/?rev=571&view=rev Author: ketiltrout Date: 2011-04-05 22:31:45 +0000 (Tue, 05 Apr 2011) Log Message: ----------- Date. Modified Paths: -------------- trunk/html/index.html Modified: trunk/html/index.html =================================================================== --- trunk/html/index.html 2011-04-05 22:28:11 UTC (rev 570) +++ trunk/html/index.html 2011-04-05 22:31:45 UTC (rev 571) @@ -134,7 +134,7 @@ <h2><a name="download">Get GetData</a></h2> <p>The complete source code for official releases of the GetData project are available from SourceForge. The latest version of GetData, released - 25 March, 2011, is <a + 5 April, 2011, is <a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/" >0.7.3</a>; see: <ul><li><a href="download.html">Get GetData</a></ul> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-05 22:28:19
|
Revision: 570 http://getdata.svn.sourceforge.net/getdata/?rev=570&view=rev Author: ketiltrout Date: 2011-04-05 22:28:11 +0000 (Tue, 05 Apr 2011) Log Message: ----------- 0.7.3 Modified Paths: -------------- trunk/html/download.html trunk/html/index.html Modified: trunk/html/download.html =================================================================== --- trunk/html/download.html 2011-04-05 22:25:39 UTC (rev 569) +++ trunk/html/download.html 2011-04-05 22:28:11 UTC (rev 570) @@ -97,16 +97,16 @@ <h2><a name="source">Latest Release</a></h2> <p>The complete source code for official releases of the GetData project are available from SourceForge. The latest version of GetData, released - 25 March, 2011, is: + 5 April, 2011, is: <ul> <li><a - href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/" - >0.7.2</a>. Three packages are available: + href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/" + >0.7.3</a>. Three packages are available: <ul> - <li><em><a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/getdata-0.7.2.tar.bz2/download">getdata-0.7.2.tar.bz2</a>/<a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/getdata-0.7.2.tar.gz/download">.gz</a>:</em> the full source code to the library, with bindings. This + <li><em><a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/getdata-0.7.3.tar.bz2/download">getdata-0.7.3.tar.bz2</a>/<a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/getdata-0.7.3.tar.gz/download">.gz</a>:</em> the full source code to the library, with bindings. This package uses the GNU autotools build system, and is designed for POSIX systems (UNIX, Linux, BSD, MacOS X, Cygwin, MSys, &c.) - <li><em><a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/getdata_win-0.7.2.zip/download">getdata_win-0.7.2.zip</a>:</em> a reduced + <li><em><a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/getdata_win-0.7.3.zip/download">getdata_win-0.7.3.zip</a>:</em> a reduced source code package, with the CMake build system designed to be built on Microsoft Windows, either using the free MinGW compiler, or else Microsoft's Visual C++ compiler. (The full source package above can @@ -116,7 +116,7 @@ dirfiles, the Legacy API, and a few other features. This build is used in native Microsoft Windows builds of <a href="http://kst.kde.org/">kst2</a>. - <li><em><a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/idl_getdata-0.7.2.tar.bz2/download">idl_getdata-0.7.2.tar.bz2</a>/<a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/idl_getdata-0.7.2.tar.gz/download">.gz</a>:</em> the Interactive Data Language (IDL) bindings, + <li><em><a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/idl_getdata-0.7.3.tar.bz2/download">idl_getdata-0.7.3.tar.bz2</a>/<a href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/idl_getdata-0.7.3.tar.gz/download">.gz</a>:</em> the Interactive Data Language (IDL) bindings, packaged separately with an autotools build system, designed to be built against an already installed version of GetData. Due to licensing restrictions, <a href="#distro">pre-built packages</a> @@ -199,10 +199,8 @@ <p>Older getdata releases available include the following: <ul> <li><a - href="http://sourceforge.net/projects/getdata/files/getdata/0.7.1/" - >0.7.1</a>—<a - href="http://sourceforge.net/projects/getdata/files/getdata/0.7.1/" - >Release Notes</a> + href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/" + >0.7.2</a> <li><a href="http://sourceforge.net/projects/getdata/files/getdata/0.6.3/" >0.6.3</a>—<a Modified: trunk/html/index.html =================================================================== --- trunk/html/index.html 2011-04-05 22:25:39 UTC (rev 569) +++ trunk/html/index.html 2011-04-05 22:28:11 UTC (rev 570) @@ -135,8 +135,8 @@ <p>The complete source code for official releases of the GetData project are available from SourceForge. The latest version of GetData, released 25 March, 2011, is <a - href="http://sourceforge.net/projects/getdata/files/getdata/0.7.2/" - >0.7.2</a>; see: + href="http://sourceforge.net/projects/getdata/files/getdata/0.7.3/" + >0.7.3</a>; see: <ul><li><a href="download.html">Get GetData</a></ul> <h2><a name="documentation">Documentation</a></h2> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-05 22:25:45
|
Revision: 569 http://getdata.svn.sourceforge.net/getdata/?rev=569&view=rev Author: ketiltrout Date: 2011-04-05 22:25:39 +0000 (Tue, 05 Apr 2011) Log Message: ----------- 0.7.3 Modified Paths: -------------- branches/getdata-0.7/RELEASE_NOTES.in Modified: branches/getdata-0.7/RELEASE_NOTES.in =================================================================== --- branches/getdata-0.7/RELEASE_NOTES.in 2011-04-05 22:23:08 UTC (rev 568) +++ branches/getdata-0.7/RELEASE_NOTES.in 2011-04-05 22:25:39 UTC (rev 569) @@ -1,28 +1,12 @@ -GetData 0.7.2 is known to compile and pass the test suite on the following -systems (including C++ and Fortran bindings): +GetData 0.7.3 fixes a few bugs found since the release of GetData-0.7.2. -Linux: -* x86, x86_64, PPC, S390, SPARC, ARM under (variously) Debian, Slackware, - Fedora, Ubuntu, CentOS -MacOS X: -* x86 and x86_64, using Xcode 3.2/gcc 4.2, under MacOS X Snow Leopard -Cygwin: -* x86_64, using gcc 4.3 -Win32: -* x86_64, using mingw/gcc 4.5, under MSys -* X86_64, using MSVC 10 - -The Python bindings have been tested with Python 2.4 through Python 2.7. - -The IDL bindings have been tested with IDL 6.0, IDL 7.1. - ------------------------------------------------------------------------------- Three packages are available: -* getdata-0.7.2.tar.bz2/.gz: the full source code to the library, with +* getdata-0.7.3.tar.bz2/.gz: the full source code to the library, with bindings. This package uses the GNU autotools build system, and is designed for POSIX systems (UNIX, Linux, BSD, MacOS X, Cygwin, MSys, &c.) -* getdata_win-0.7.2.zip: a reduced source code package, with the CMake build +* getdata_win-0.7.3.zip: a reduced source code package, with the CMake build system designed to be built on Microsoft Windows, either using the free MinGW compiler, or else Microsoft's Visual C++ compiler. (The full source package above can also be built using MinGW, if the MSys shell is @@ -30,7 +14,7 @@ this package are the C++ bindings, and the package lacks support for compressed dirfiles, the Legacy API, and a few other features. This build is used in native Microsoft Windows builds of kst2. -* idl_getdata-0.7.2.tar.bz2/.gz: the Interactive Data Language (IDL) bindings, +* idl_getdata-0.7.3.tar.bz2/.gz: the Interactive Data Language (IDL) bindings, packaged separately with an autotools build system, designed to be built against an already installed version of GetData. Due to licensing restrictions, pre-built packages rarely come with these bindings, and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-05 22:23:14
|
Revision: 568 http://getdata.svn.sourceforge.net/getdata/?rev=568&view=rev Author: ketiltrout Date: 2011-04-05 22:23:08 +0000 (Tue, 05 Apr 2011) Log Message: ----------- 0.7.3. Modified Paths: -------------- branches/getdata-0.7/ChangeLog branches/getdata-0.7/m4/version.m4 Modified: branches/getdata-0.7/ChangeLog =================================================================== --- branches/getdata-0.7/ChangeLog 2011-04-05 01:02:25 UTC (rev 567) +++ branches/getdata-0.7/ChangeLog 2011-04-05 22:23:08 UTC (rev 568) @@ -1,4 +1,4 @@ -2011-03-25 D. V. Wiebe <ge...@ke...> svn:567 +2011-04-04 D. V. Wiebe <ge...@ke...> svn:567 Merge from trunk, r561: * util/checkdirfile.c: Zero-terminate option list. Patch from Matthew Modified: branches/getdata-0.7/m4/version.m4 =================================================================== --- branches/getdata-0.7/m4/version.m4 2011-04-05 01:02:25 UTC (rev 567) +++ branches/getdata-0.7/m4/version.m4 2011-04-05 22:23:08 UTC (rev 568) @@ -20,7 +20,7 @@ m4_define(getdata_major, 0) m4_define(getdata_minor, 7) -m4_define(getdata_revision, 2) +m4_define(getdata_revision, 3) m4_define(getdata_extra, []) m4_define(getdata_version, getdata_major.getdata_minor.getdata_revision[]getdata_extra) @@ -28,7 +28,7 @@ dnl libgetdata current interface version m4_define(getdata_iface_version, 4) dnl libgetdata current interface implementation revision -m4_define(getdata_impl_revision, 2) +m4_define(getdata_impl_revision, 3) dnl libgetdata interface age (current interface - oldest supported interface) m4_define(getdata_iface_age, 0) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-05 01:02:31
|
Revision: 567 http://getdata.svn.sourceforge.net/getdata/?rev=567&view=rev Author: ketiltrout Date: 2011-04-05 01:02:25 +0000 (Tue, 05 Apr 2011) Log Message: ----------- dirfile2ascii fix from trunk. Modified Paths: -------------- branches/getdata-0.7/ChangeLog branches/getdata-0.7/NEWS branches/getdata-0.7/util/dirfile2ascii.c Modified: branches/getdata-0.7/ChangeLog =================================================================== --- branches/getdata-0.7/ChangeLog 2011-04-04 09:13:24 UTC (rev 566) +++ branches/getdata-0.7/ChangeLog 2011-04-05 01:02:25 UTC (rev 567) @@ -1,3 +1,9 @@ +2011-03-25 D. V. Wiebe <ge...@ke...> svn:567 + Merge from trunk, r561: + + * util/checkdirfile.c: Zero-terminate option list. Patch from Matthew + Truch. + 2011-04-03 D. V. Wiebe <ge...@ke...> svn:564 * test/alter_crecip_zero.c test/alter_recip_zero.c: Added. * src/mod.c (_GD_Change): If [c]dividend is zero, don't change it, per Modified: branches/getdata-0.7/NEWS =================================================================== --- branches/getdata-0.7/NEWS 2011-04-04 09:13:24 UTC (rev 566) +++ branches/getdata-0.7/NEWS 2011-04-05 01:02:25 UTC (rev 567) @@ -11,6 +11,10 @@ * BUG FIX: gd_raw_filename() wasn't clearing the Dirfile error before operation, resulting in it failing erroneously in certain situations. + Utilities Changes: + + * BUG FIX: A potential segmentation fault has been patched in dirfile2ascii. + |==============================================================================| New in version 0.7.2: Modified: branches/getdata-0.7/util/dirfile2ascii.c =================================================================== --- branches/getdata-0.7/util/dirfile2ascii.c 2011-04-04 09:13:24 UTC (rev 566) +++ branches/getdata-0.7/util/dirfile2ascii.c 2011-04-05 01:02:25 UTC (rev 567) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Matthew Truch +/* Copyright (C) 2010, 2011 Matthew Truch * Copyright (C) 2010 D. V. Wiebe * *************************************************************************** @@ -188,7 +188,8 @@ { "quiet", 0, NULL, 'q' }, { "skip", 1, NULL, 's' }, { "verbose", 0, NULL, 'v' }, - { "version", 0, NULL, 2 } + { "version", 0, NULL, 2 }, + { 0, 0, 0, 0 } }; /* handy things to know about conversion specifiers */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-04 09:13:37
|
Revision: 566 http://getdata.svn.sourceforge.net/getdata/?rev=566&view=rev Author: ketiltrout Date: 2011-04-04 09:13:24 +0000 (Mon, 04 Apr 2011) Log Message: ----------- Perl. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/TODO trunk/getdata/bindings/Makefile.am trunk/getdata/bindings/idl/test/big_test.pro trunk/getdata/bindings/make_parameters.c trunk/getdata/bindings/python/test/big_test.py trunk/getdata/configure.ac trunk/getdata/doc/list.tests trunk/getdata/src/add.c Added Paths: ----------- trunk/getdata/bindings/perl/ trunk/getdata/bindings/perl/GetData.pm.in trunk/getdata/bindings/perl/GetData.xs trunk/getdata/bindings/perl/Makefile.am trunk/getdata/bindings/perl/simple_funcs.pl trunk/getdata/bindings/perl/simple_funcs.xsin trunk/getdata/bindings/perl/test/ trunk/getdata/bindings/perl/test/Makefile.am trunk/getdata/bindings/perl/test/big_test.pl trunk/getdata/bindings/perl/test/callback.pl trunk/getdata/bindings/perl/typemap trunk/getdata/m4/perl.m4 Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2011-04-03 11:19:43 UTC (rev 565) +++ trunk/getdata/ChangeLog 2011-04-04 09:13:24 UTC (rev 566) @@ -1,3 +1,9 @@ +2011-03-25 D. V. Wiebe <ge...@ke...> svn:566 + * src/perl.m4: Added. + * configure.ac: Perl tests. + * bindings/make_parameters.c (Perl): Added. + * Bindings/perl: Added. + 2011-03-25 D. V. Wiebe <ge...@ke...> svn:561 * util/checkdirfile.c: Zero-terminate option list. Patch from Matthew Truch. Modified: trunk/getdata/TODO =================================================================== --- trunk/getdata/TODO 2011-04-03 11:19:43 UTC (rev 565) +++ trunk/getdata/TODO 2011-04-04 09:13:24 UTC (rev 566) @@ -1,7 +1,12 @@ -* Perl bindings * Locking * Hashed compressed files * streaming * linterp table path munging [MH] * Make webpage suck less * Handle RW dirfile on RO data better [JPF] +* INCLUDE name munging [RW/MT] +* Fix VERSION leakage [MT] +* Error count [MT] +* aliasing [MT] +* Fix REFERENCE spam [MT] +* Fragment encapsulation [MT] Modified: trunk/getdata/bindings/Makefile.am =================================================================== --- trunk/getdata/bindings/Makefile.am 2011-04-03 11:19:43 UTC (rev 565) +++ trunk/getdata/bindings/Makefile.am 2011-04-04 09:13:24 UTC (rev 566) @@ -38,15 +38,20 @@ PY_SUBDIR=python endif +if MAKE_PERLBINDINGS +PERL_SUBDIR=perl +endif + noinst_PROGRAMS=make_parameters make_parameters_SOURCES = make_parameters.c nodist_make_parameters_SOURCES = ../src/getdata.h -SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${PY_SUBDIR} ${IDL_SUBDIR} +SUBDIRS = . ${F77_SUBDIR} ${CXX_SUBDIR} ${PY_SUBDIR} ${IDL_SUBDIR} \ + ${PERL_SUBDIR} make_parameters$(EXEEXT): $(make_parameters_SOURCES) $(nodist_make_parameters_SOURCES) - ${BUILDCC} -I../src -o make_parameters$(EXEEXT) $(srcdir)/$(make_parameters_SOURCES) + ${BUILDCC} $(DEFS) -I../src -o make_parameters$(EXEEXT) $(srcdir)/$(make_parameters_SOURCES) clean-local: rm -rf *~ Modified: trunk/getdata/bindings/idl/test/big_test.pro =================================================================== --- trunk/getdata/bindings/idl/test/big_test.pro 2011-04-03 11:19:43 UTC (rev 565) +++ trunk/getdata/bindings/idl/test/big_test.pro 2011-04-04 09:13:24 UTC (rev 566) @@ -980,7 +980,7 @@ nume += check_simple2(148, 5, n.comp_scal, 1) nume += check_simple2(148, 6, n.cdividend, DCOMPLEX(33.3, 44.4)) -; 152: gd_alter_multiply +; 152: gd_alter_divide gd_alter_divide, d, "new14", in_field1="in6" nume += check_ok2(152, 1, d) @@ -991,7 +991,7 @@ nume += check_simple2(152, 3, n.fragment, 0) nume += check_simple2(152, 4, n.in_fields, [ "in6", "in3" ]) -; 153: gd_alter_multiply +; 153: gd_alter_recip gd_alter_recip, d, "new16", dividend=1.01 nume += check_ok2(153, 1, d) Modified: trunk/getdata/bindings/make_parameters.c =================================================================== --- trunk/getdata/bindings/make_parameters.c 2011-04-03 11:19:43 UTC (rev 565) +++ trunk/getdata/bindings/make_parameters.c 2011-04-04 09:13:24 UTC (rev 566) @@ -1,4 +1,4 @@ -/* Copyright (C) 2008-2010 D. V. Wiebe +/* Copyright (C) 2008-2011 D. V. Wiebe * *************************************************************************** * @@ -19,7 +19,7 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifdef HAVE_CONFIG_H -#include <config.h> +#include "config.h" #endif #include <stdlib.h> @@ -346,6 +346,26 @@ printf("return r; }\n"); } +void Perl(void) +{ + int i; + + printf("s/@PARAMETERS@/"); + + printf("our $VERSION = %i.%04i;\\\n", GETDATA_MAJOR, GETDATA_MINOR * 100 + + GETDATA_REVISION); + for (i = 0; constant_list[i].lname != NULL; ++i) + printf("our $%s = %li;\\\n", constant_list[i].sname, + constant_list[i].value); + + printf("/\n"); + printf("s/@PARAMLIST@/"); + + for (i = 0; constant_list[i].lname != NULL; ++i) + printf("%s\\\n", constant_list[i].sname, constant_list[i].value); + printf("/\n"); +} + int main(int argc, char* argv[]) { if (argv[1][0] == 'f') @@ -354,6 +374,8 @@ Python(); else if (argv[1][0] == 'i') IDL(); + else if (argv[1][0] == 'P') + Perl(); return 0; } Added: trunk/getdata/bindings/perl/GetData.pm.in =================================================================== --- trunk/getdata/bindings/perl/GetData.pm.in (rev 0) +++ trunk/getdata/bindings/perl/GetData.pm.in 2011-04-04 09:13:24 UTC (rev 566) @@ -0,0 +1,132 @@ +# Copyright (C) 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 +# +package GetData; + +use 5.00800; +use strict; +use warnings; + +require Exporter; +require XSLoader; +require Math::Complex; + +our @ISA = qw(Exporter); +our %EXPORT_TAGS = ( 'all' => [ qw(VERSION + @FUNCLIST@ + @PARAMLIST@ + ) ] ); + +our @EXPORT_OK = ( @{$EXPORT_TAGS{'all'}} ); +our @EXPORT = qw(); + +@PARAMETERS@ + +XSLoader::load('GetData', $VERSION); + +1; +__END__ + +=head1 NAME + +GetData - Perl bindings to the GetData library for Dirfile access + +=head1 SYNOPSIS + + use GetData; + + my $DIRFILE = GetData::open("./dirfile/", $GetData::RDONLY); + + # the following calls are equivalent + my $data = GetData::getdata($DIRFILE, "field", 5, 0, 1, + GetData::UINT8); + my $data = $DIRFILE->getdata("field", 5, 0, 1, GetData::UINT8); + +=head1 DESCRIPTION + +This module provides simple, lightweight bindings from Perl to the C GetData +library. It provides a simple mapping between public C functions and Perl +methods. All C functions and constants are replicated in the GetData package. +These methods have the same name as their C counterparts, excluding the C +namespace prefix `gd_' (or `GD_', for C preprocessor constants). + +The dirfile lvalue returned by GetData::cbopen or GetData::cbopen is a +simplistic object. Any GetData method which takes a dirfile as a parameter, +may instead be called as method of the dirfile object itself. (See the +synopsis above for an example.) Dirfile metadata entries (which are C structs +of type gd_entry_t) are represented as simple hashes. + +By default, GetData does not export any symbols. All symbols in the GetData +package may be exported with: + + use GetData "all"; + +but this is discouraged, as it will overwrite useful things like &open. + +=head1 METHODS + +=over + +=item cbopen ( DIRFILENAME, FLAGS, SEHANDLER, EXTRA ) + +Create or open a Dirfile database called DIRFILENAME. FLAGS should be either +$GetData::RDONLY (for read-only access) or $GetData::RDWR (for read-write +access), optionally bitwise or'd with any of the flags listed in the +gd_cbopen(3) manual page. + +SEHANDLER is a Perl callback function which will be executed whenever a syntax +error is encountered. It may be undef, if no callback is desired (but see the +open() method in that case). If called, SEHANDLER will be passed two arguments. +The first is a reference to a hash containing the parser data. The second is +the EXTRA object passed to cbopen(). SEHANDLER is called in scalar context, +and should return either: + +=over + +=item * an integer, one of the $GetData::SYNTAX_... constants; or + +=item * a string containing the corrected line, in which case +$GetData::SYNTAX_RESCAN is assumed; or, + +=item * a reference to a list consisting of an integer, one of the +$GetData::SYNTAX_... constants, and then, optionally, a string containing the +corrected line. + +=back + +This function always returns a valid Dirfile object, even if the call failed; +the caller should check GetData::error() on the returned dirfile to test for +success. + +=head1 COPYRIGHT + +Copyright (C) 2011 D. V. Wiebe + +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. + +=cut Added: trunk/getdata/bindings/perl/GetData.xs =================================================================== --- trunk/getdata/bindings/perl/GetData.xs (rev 0) +++ trunk/getdata/bindings/perl/GetData.xs 2011-04-04 09:13:24 UTC (rev 566) @@ -0,0 +1,1859 @@ +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" +#undef _BSD_SOURCE +#undef _POSIX_SOURCE +#undef _SVID_SOURCE +#include "../../src/internal.h" + +/* Perl 5.8.9 and earlier don't provide hv_fetchs */ +#ifdef hv_fetchs +# define gdp_hv_fetchs hv_fetchs +#else +# define gdp_hv_fetchs(hv,key,lval) hv_fetch(hv, key, sizeof(key) - 1, lval) +#endif + +#define undef &PL_sv_undef + +/* lfs hackery */ +#if defined _LARGEFILE64_SOURCE || (defined _FILE_OFFSET_BITS && \ + _FILE_OFFSET_BITS == 64) || (defined __CYGWIN__) || (defined __APPLE__) +# define gdp64(x) x ## 64 +#else +# define gdp64(x) x +#endif + +/* fake data types to simplify our typemap */ +typedef complex double gdp_complex_in; +typedef _Complex double gdpu_complex; +typedef gd_bit_t gdpu_bitnum_t; +typedef gd_bit_t gdpu_numbits_t; +typedef gd_shift_t gdpu_shift_t; +typedef gd_spf_t gdpu_spf_t; +typedef gd_type_t gdpu_type_t; +typedef int gdpu_int; +typedef const char gdpu_char; + +#define GDP_DIRFILE_ALIAS \ + const char *gdp_package = ix ? "GetData::Dirifle" : "GetData"; + +#define GDP_UNDEF_ON_ERROR(x) \ + if (gd_error(dirfile)) { x; dreturnvoid(); XSRETURN_UNDEF; } + +#define GDP_PUSHpvn(s) XPUSHs(sv_2mortal(newSVpvn(s, sizeof(s) - 1))) +#define GDP_PUSHpvz(s) XPUSHs(sv_2mortal(newSVpv(s, 0))) +#define GDP_PUSHuv(s) XPUSHs(sv_2mortal(newSVuv(s))) +#define GDP_PUSHiv(s) XPUSHs(sv_2mortal(newSViv(s))) +#define GDP_PUSHnv(s) XPUSHs(sv_2mortal(newSVnv(s))) +#define GDP_PUSHrv(s) XPUSHs(sv_2mortal(newRV_noinc((SV*)s))) +#define GDP_PUSHcmp(s) XPUSHs(sv_2mortal(gdp_newSVcmp(s))) +#define GDP_PUSHrvavpv(s,n) XPUSHs(sv_2mortal(gdp_newRVavpv((const char**)s,n))) +#define GDP_PUSHrvavcmp(s,n) XPUSHs(sv_2mortal(gdp_newRVavcmp(s,n))) +#define GDP_PUSHrvavnv(s,n) XPUSHs(sv_2mortal(gdp_newRVavnv(s,n))) + +struct gdp_callback_stuff_t { + SV *func; + SV *data; +}; + +struct gdp_dirfile_t { + DIRFILE *D; + struct gdp_callback_stuff_t cbdata; +}; + +static DIRFILE *gdp_invalid = NULL; + + +/* sv might be NULL, indicating undef */ +static gd_type_t gdp_get_type(SV **sv, const char *pkg, const char *func) +{ + dtrace("%p, \"%s\", \"%s\"", sv, pkg, func); + + if (sv == NULL && *sv == undef) + croak("%s::%s() - Value may not be undef", pkg, func); + + if (sv_isa(*sv, "Math::Complex")) { + dreturn("%03x", GD_COMPLEX128); + return GD_COMPLEX128; + } else if (SvTYPE(*sv) == SVt_IV) { + dreturn("%03x", GD_INT64); + return GD_INT64; + } + + dreturn("%03x", GD_FLOAT64); + return GD_FLOAT64; +} + +/* convert a Perl object into a c99 complex number */ +static complex double gdp_cmp_to_c99(SV *src, int *ok, const char* pkg, + const char *func) +{ + dtrace("%p, %p, \"%s\", \"%s\"", src, ok, pkg, func); + double complex val = 0; + + if (sv_isa(src, "Math::Complex")) { + HV *hv = (HV *)SvRV(src); + SV **c_dirty = gdp_hv_fetchs(hv, "c_dirty", 0); + if (c_dirty == NULL) + croak("%s::%s() - Malformed Math::Complex object", pkg, func); + if (SvIV(*c_dirty)) { + SV **sv = gdp_hv_fetchs(hv, "polar", 0); + if (sv == NULL || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV) + croak("%s::%s() - Malformed Math::Complex object", pkg, func); + + AV *data = (AV*)SvRV(*sv); + SV **m = av_fetch(data, 0, 0); + SV **a = av_fetch(data, 1, 0); + if (m == NULL || a == NULL) + croak("%s::%s() - Malformed Math::Complex object", pkg, func); + val = SvNV(*m) * cexp(SvNV(*a)); + } else { + SV **sv = gdp_hv_fetchs(hv, "cartesian", 0); + if (sv == NULL || !SvROK(*sv) || SvTYPE(SvRV(*sv)) != SVt_PVAV) + croak("%s::%s() - Malformed Math::Complex object", pkg, func); + + AV *data = (AV*)SvRV(*sv); + SV **r = av_fetch(data, 0, 0); + SV **i = av_fetch(data, 1, 0); + if (r == NULL || i == NULL) + croak("%s::%s() - Malformed Math::Complex object", pkg, func); + val = SvNV(*r) + _Complex_I * SvNV(*i); + } + } else if (ok) /* if ok is non-NULL, the caller is prepared to handle + non-complex data */ + *ok = 0; + else + val = SvNV(src); + + dreturn("%g;%g", creal(val), cimag(val)); + return val; +} + +#define GDP_EHASH_FETCH(key) \ + v = gdp_hv_fetchs((HV*)sv, key, 0); \ + if (v == NULL) \ + croak("%s::%s() - Missing required key '" key "' in entry hash", pkg, func) + +#define GDP_EHASH_FETCH_CMP(key,member) do { \ + GDP_EHASH_FETCH(key); E->member = gdp_cmp_to_c99(*v, NULL, pkg, func); \ + } while(0) + +#define GDP_EHASH_FETCH_IV(key,member,type) \ + do { GDP_EHASH_FETCH(key); E->member = (type)SvIV(*v); } while(0) + +#define GDP_EHASH_FETCH_NV(key,member) \ + do { GDP_EHASH_FETCH(key); E->member = SvNV(*v); } while(0) + +#define GDP_EHASH_FETCH_UV(key,member,type) \ + do { GDP_EHASH_FETCH(key); E->member = (type)SvUV(*v); } while(0) + +#define GDP_EHASH_FETCH_UV_REQ(key,member,type) \ + do { GDP_EHASH_FETCH_REQ(key); E->member = (type)SvUV(*v); } while(0) + +#define GDP_EHASH_FETCH_PV(key,member) \ + do { \ + GDP_EHASH_FETCH(key); \ + E->member = (!SvOK(*v)) ? NULL : SvPV_nolen(*v); \ + } while(0) + +/* populate a complex double array in gd_entry_t */ +static void gdp_fetch_cmp_list(complex double *c, HV *hv, const char* key, + int n, const char *pkg, const char *func) +{ + dtrace("%p, %p, \"%s\", %i, \"%s\", \"%s\"", c, hv, key, n, pkg, func); + int i; + SV **v = hv_fetch(hv, key, strlen(key), 0); + + if (v == NULL) + croak("%s::%s() - Missing required key '%s' in entry hash", pkg, func, key); + + if (SvTYPE(*v) != SVt_PVAV) + croak("%s::%s() - Key '%s' must be list in entry hash", pkg, func, key); + + for (i = 0; i < n; ++i) { + v = av_fetch((AV*)*v, i, 0); + if (v) + c[i] = gdp_cmp_to_c99(*v, NULL, pkg, func); + } + + dreturnvoid(); +} + +/* populate in_fields in gd_entry_t */ +static void gdp_fetch_in_fields(char **in_fields, SV *sv, int n, + const char *pkg, const char *func) +{ + dtrace("%p, %p, %i, \"%s\", \"%s\"", in_fields, sv, n, pkg, func); + int i; + SV **v; + + GDP_EHASH_FETCH("in_fields"); + + if (SvTYPE(*v) != SVt_PVAV) + croak("%s::%s() - Key 'in_fields' must be list in entry hash", pkg, func); + + for (i = 0; i < n; ++i) { + v = av_fetch((AV*)*v, i, 0); + if (v) + in_fields[i] = SvPV_nolen(*v); + } + + dreturnvoid(); +} + +/* populate scalar elements of gd_entry_t */ +static void gdp_fetch_scalars(gd_entry_t *E, HV *hv, unsigned int mask, + const char *pkg, const char* func) +{ + dtrace("%p, %p, %06x \"%s\", \"%s\"", E, hv, mask, pkg, func); + int i; + + SV **scalar = gdp_hv_fetchs(hv, "scalar", 0); + SV **scalar_ind = gdp_hv_fetchs(hv, "scalar_ind", 0); + SV **v; + + /* there's no point in recording scalar indicies if we don't have scalars */ + if (scalar == NULL) { + dreturnvoid(); + return; + } + + if (SvTYPE(*scalar) != SVt_PVAV) + croak("%s::%s() - Key 'scalar' must be list in entry hash", pkg, func); + if (scalar_ind && SvTYPE(*scalar_ind) != SVt_PVAV) + croak("%s::%s() - Key 'scalar_ind' must be list in entry hash", pkg, func); + + for (i = 0; i <= GD_MAX_POLYORD; ++i) + if (mask & (1 << i)) { + v = av_fetch((AV*)*scalar, i, 0); + if (v) { + E->scalar[i] = SvPV_nolen(*v); + if (scalar_ind) { + v = av_fetch((AV*)*scalar_ind, i, 0); + if (v) + E->scalar_ind[i] = SvIV(*v); + } + } + } + + dreturnvoid(); +} + +/* convert a Perl hash into a gd_entry_t */ +static void gdp_to_entry(gd_entry_t *E, SV *sv, const char *pkg, + const char *func) +{ + dtrace("%p, %p, \"%s\", \"%s\"", E, sv, pkg, func); + SV **v; + int n; + + memset(E, 0, sizeof(gd_entry_t)); + + /* de-reference as needed */ + while (SvROK(sv)) + sv = SvRV(sv); + + if (SvTYPE(sv) != SVt_PVHV) + croak("%s::%s() - Entry must be hash", pkg, func); + + GDP_EHASH_FETCH_UV("field_type", field_type, gd_entype_t); + GDP_EHASH_FETCH_PV("field", field); + GDP_EHASH_FETCH_UV("fragment_index", fragment_index, int); + + switch (E->field_type) { + case GD_BIT_ENTRY: + case GD_SBIT_ENTRY: + GDP_EHASH_FETCH_PV("in_field", in_fields[0]); + GDP_EHASH_FETCH_UV("bitnum", bitnum, gd_bit_t); + GDP_EHASH_FETCH_UV("numbits", bitnum, gd_bit_t); + gdp_fetch_scalars(E, (HV*)sv, 0x3, pkg, func); + break; + case GD_CARRAY_ENTRY: + GDP_EHASH_FETCH_IV("array_len", array_len, size_t); + /* fallthrough */ + case GD_CONST_ENTRY: + GDP_EHASH_FETCH_UV("const_type", const_type, gd_type_t); + break; + case GD_LINCOM_ENTRY: + GDP_EHASH_FETCH_IV("n_fields", n_fields, int); + n = (E->n_fields > GD_MAX_LINCOM) ? GD_MAX_LINCOM : n; + gdp_fetch_in_fields(E->in_fields, sv, n, pkg, func); + E->comp_scal = 1; + gdp_fetch_cmp_list(E->cm, (HV*)sv, "cm", n, pkg, func); + gdp_fetch_cmp_list(E->cb, (HV*)sv, "cb", n, pkg, func); + gdp_fetch_scalars(E, (HV*)sv, ((1 << n) - 1) * 9, pkg, func); + break; + case GD_LINTERP_ENTRY: + GDP_EHASH_FETCH_PV("in_field", in_fields[0]); + GDP_EHASH_FETCH_PV("table", table); + break; + case GD_MULTIPLY_ENTRY: + case GD_DIVIDE_ENTRY: + gdp_fetch_in_fields(E->in_fields, sv, 2, pkg, func); + break; + case GD_PHASE_ENTRY: + GDP_EHASH_FETCH_PV("in_field", in_fields[0]); + GDP_EHASH_FETCH_IV("shift", shift, gd_shift_t); + gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); + break; + case GD_POLYNOM_ENTRY: + GDP_EHASH_FETCH_PV("in_field", in_fields[0]); + GDP_EHASH_FETCH_IV("poly_ord", poly_ord, int); + n = (E->poly_ord > GD_MAX_POLYORD) ? GD_MAX_POLYORD : n; + E->comp_scal = 1; + gdp_fetch_cmp_list(E->ca, (HV*)sv, "ca", n, pkg, func); + gdp_fetch_scalars(E, (HV*)sv, (1 << (n + 1)) - 1, pkg, func); + break; + case GD_RECIP_ENTRY: + GDP_EHASH_FETCH_PV("in_field", in_fields[0]); + E->comp_scal = 1; + GDP_EHASH_FETCH_CMP("cdividend", cdividend); + gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); + break; + case GD_RAW_ENTRY: + GDP_EHASH_FETCH_UV("spf", spf, gd_spf_t); + GDP_EHASH_FETCH_UV("data_type", data_type, gd_type_t); + gdp_fetch_scalars(E, (HV*)sv, 1, pkg, func); + break; + case GD_NO_ENTRY: + case GD_INDEX_ENTRY: + case GD_STRING_ENTRY: + break; + default: + croak("%s::%s() - Invalid field type %x in entry hash", pkg, func, + E->field_type); + } + + dreturnvoid(); +} + +/* convert a single perl datum into the desired type */ +static void gdp_convert_from_perl(void *dest, SV *src, gd_type_t type, + const char *pkg, const char *func) +{ + dtrace("%p, %p, %03x, \"%s\", \"%s\"", dest, src, type, pkg, func); + double complex c; + int cmp = 1; + + /* undef results in randomness */ + if (src == NULL) { + dreturnvoid(); + return; + } + + /* check for and convert complex data */ + c = gdp_cmp_to_c99(src, &cmp, pkg, func); + + switch (type) { + case GD_UINT8: + *(uint8_t*)dest = cmp ? (uint8_t)creal(c) : (uint8_t)SvUV(src); + break; + case GD_INT8: + *(int8_t*)dest = cmp ? (int8_t)creal(c) : (int8_t)SvIV(src); + break; + case GD_UINT16: + *(uint16_t*)dest = cmp ? (uint16_t)creal(c) : (uint16_t)SvUV(src); + break; + case GD_INT16: + *(int16_t*)dest = cmp ? (int16_t)creal(c) : (int16_t)SvIV(src); + break; + case GD_UINT32: + *(uint32_t*)dest = cmp ? (uint32_t)creal(c) : (uint32_t)SvUV(src); + break; + case GD_INT32: + *(int32_t*)dest = cmp ? (int32_t)creal(c) : (int32_t)SvIV(src); + break; + case GD_UINT64: + *(uint64_t*)dest = cmp ? (uint64_t)creal(c) : (uint64_t)SvUV(src); + break; + case GD_INT64: + *(int64_t*)dest = cmp ? (int64_t)creal(c) : (int64_t)SvIV(src); + break; + case GD_FLOAT32: + *(float*)dest = cmp ? (float)creal(c) : (float)SvNV(src); + break; + case GD_FLOAT64: + *(double*)dest = cmp ? (double)creal(c) : (double)SvNV(src); + break; + case GD_COMPLEX64: + *(complex float*)dest = cmp ? (complex float)c : (complex float)SvNV(src); + break; + case GD_COMPLEX128: + *(complex double*)dest = cmp ? c : (complex double)SvNV(src); + break; + case GD_NULL: + case GD_UNKNOWN: + ; + } + + dreturnvoid(); +} + +struct gdp_din { + void *data_in; + gd_type_t type; + int arg_type; + size_t nsamp; +}; + +#define GDP_DATA_IN_LIST 0 +#define GDP_DATA_IN_PACK 1 +#define GDP_DATA_IN_REF 2 +static struct gdp_din gdp_convert_data(SV *d, I32 items, I32 ax, size_t idx, + const char *pkg, const char *func) +{ + struct gdp_din din = {NULL, GD_NULL, GDP_DATA_IN_PACK, 0}; + size_t i; + AV *av = NULL; + + dtrace("%p, %i, %i, %zi, \"%s\", \"%s\"", d, (int)items, (int)ax, idx, pkg, + func); + + /* argument grokking goes thus (in order!): + * if d == undef, the remaining arguments are taken to be data + * if d == reference to an array, the array is taken to be data, and + * remaining arguments ignored + * if there is exactly one argument after d, d is taken as a type code + * and the following argument as either packed data or a + * reference to a list. + * otherwise, d is taken to be the first datum in a list of data. + */ + + if (d == undef) { + idx++; + din.arg_type = GDP_DATA_IN_LIST; + } else if (sv_isa(d, "Math::Complex")) + din.arg_type = GDP_DATA_IN_LIST; + else if (SvROK(d)) { + av = (AV*)SvRV(d); + din.arg_type = GDP_DATA_IN_REF; + } else if (items != 6) + din.arg_type = GDP_DATA_IN_LIST; + else if (SvROK(ST(5))) { + av = (AV*)SvRV(ST(5)); + din.arg_type = GDP_DATA_IN_REF; + } + + if (din.arg_type == GDP_DATA_IN_LIST) { + din.nsamp = items - idx; + din.type = gdp_get_type(&ST(idx), pkg, func); + } else if (din.arg_type == GDP_DATA_IN_REF) { + if (SvTYPE((SV*)av) != SVt_PVAV) + croak("%s::%s() - Expected array reference, but found some other " + "type of object", pkg, func); + din.nsamp = (size_t)av_len(av) + 1; + din.type = gdp_get_type(av_fetch(av, 0, 0), pkg, func); + } else { + din.type = (gd_type_t)SvIV(d); + if (GD_SIZE(din.type) == 0) + croak("%s::%s() - Invalid type code", pkg, func); + STRLEN n; + din.data_in = SvPV(ST(5), n); + din.nsamp = (size_t)n / GD_SIZE(din.type); + } + + if (din.arg_type != GDP_DATA_IN_PACK) + din.data_in = safemalloc(din.nsamp * GD_SIZE(din.type)); + + if (din.arg_type == GDP_DATA_IN_LIST) { + for (i = idx; i < items; ++i) + gdp_convert_from_perl((char*)din.data_in + GD_SIZE(din.type) * (i - idx), + ST(i), din.type, pkg, func); + } else if (din.arg_type == GDP_DATA_IN_REF) { + for (i = 0; i < din.nsamp; ++i) { + SV **sv = av_fetch(av, i, 0); + if (sv == NULL) + croak("%s::%s() - Undefined datum encountered", pkg, func); + gdp_convert_from_perl((char*)din.data_in + GD_SIZE(din.type) * i, *sv, + din.type, pkg, func); + } + } + + dreturn("{ %p, %03x, %i, %zi }", din.data_in, din.type, din.arg_type, + din.nsamp); + return din; +} + +/* convert perl datum (in some sort of format) into an appropriate + * C datum, with type */ +static gd_type_t gdp_to_voidp(void *dest, SV *src, gd_type_t hint, + const char *pkg, const char *func) +{ + dtrace("%p, %p, %03x, \"%s\", \"%s\"", dest, src, hint, pkg, func); + gd_type_t type = GD_UNKNOWN; + + /* treat undef as zero */ + if (src == undef) { + memset(dest, 0, 1); + type = GD_UINT8; + } else { + int cmp = 0; + complex double c = gdp_cmp_to_c99(src, &cmp, pkg, func); + + if (cmp) { + memcpy(dest, &c, sizeof(complex double)); + type = GD_COMPLEX128; + } else if (SvNOK(src)) { + *(double*)dest = SvNV(src); + type = GD_FLOAT64; + } else if (SvUOK(src)) { + *(uint64_t*)dest = (uint64_t)SvUV(src); + type = GD_UINT64; + } else if (SvIOK(src)) { + *(int64_t*)dest = (int64_t)SvIV(src); + type = GD_INT64; + } else if (hint & GD_COMPLEX || hint & GD_IEEE754) { + *(double*)dest = SvNV(src); + type = GD_FLOAT64; + } else if (hint & GD_SIGNED) { + *(int64_t*)dest = (int64_t)SvIV(src); + type = GD_INT64; + } else { + *(uint64_t*)dest = (uint64_t)SvUV(src); + type = GD_UINT64; + } + } + + dreturn("%03x", type); + return type; +} + +static SV *gdp_newSVcmp(double complex v) +{ + SV **dummy; + SV *sv; + /* build a list containing the data, and take it's reference */ + AV *av = newAV(); + av_extend(av, 1); + av_store(av, 0, newSVnv(creal(v))); + av_store(av, 1, newSVnv(cimag(v))); + sv = newRV_noinc((SV*)av); + + /* create a Math::Complex object */ + HV *hv = newHV(); + dummy = hv_store(hv, "p_dirty", 7, newSVuv(1), 0); + dummy = hv_store(hv, "c_dirty", 7, newSVuv(0), 0); + dummy = hv_store(hv, "cartesian", 9, sv, 0); + HV *stash = gv_stashpv("Math::Complex", GV_ADD); + sv = sv_bless(newRV_noinc((SV*)hv), stash); + return sv; +} + +/* convert a char ** into a reference to a list of strings */ +static SV *gdp_newRVavpv(const char **l, size_t n) +{ + dtrace("%p, %zi", l, n); + SV *rv; + int i; + AV *av = newAV(); + av_extend(av, n - 1); + + for (i = 0; i < n; ++i) + av_store(av, i, newSVpv(l[i], 0)); + + rv = newRV_noinc((SV*)av); + dreturn("%p", rv); + return rv; +} + +/* convert a complex double * into a reference to a list of complex data */ +static SV *gdp_newRVavcmp(const complex double *l, size_t n) +{ + dtrace("%p, %zi", l, n); + SV *rv; + int i; + AV *av = newAV(); + av_extend(av, n - 1); + + for (i = 0; i < n; ++i) + av_store(av, i, gdp_newSVcmp(l[i])); + + rv = newRV_noinc((SV*)av); + dreturn("%p", rv); + return rv; +} + +/* store some scalar values in the entry hash on the stack from the gd_entry_t +*/ +static SV **gdp_store_scalars(SV **sp, const gd_entry_t *E, unsigned int mask) +{ + dtrace("%p, %p, %06x", sp, E, mask); + int i; + + if (!mask) { + dreturn("%p", sp); + return sp; + } + + AV *scalar = newAV(); + AV *scalar_ind = newAV(); + av_extend(scalar, GD_MAX_POLYORD); + av_extend(scalar_ind, GD_MAX_POLYORD); + for (i = 0; i <= GD_MAX_POLYORD; ++i) + if (mask & (1 << i)) { + av_store(scalar, i, newSVpv(E->scalar[i], 0)); + if (E->scalar[i] == NULL) + av_store(scalar_ind, i, undef); + else + av_store(scalar_ind, i, newSViv(E->scalar_ind[i])); + } + GDP_PUSHpvn("scalar"); + GDP_PUSHrv(scalar); + GDP_PUSHpvn("scalar_ind"); + GDP_PUSHrv(scalar_ind); + + dreturn("%p", sp); + return sp; +} + +/* parser callback wrapper */ +static int gdp_parser_callback(gd_parser_data_t *pdata, void *extra) +{ + SV *callback_func = ((struct gdp_callback_stuff_t *)extra)->func; + SV *callback_data = ((struct gdp_callback_stuff_t *)extra)->data; + SV *ret, **dummy; + int n, sem = GD_SYNTAX_ABORT; + int was_rv = 0; + + /* local stack pointer */ + dSP; + + dtrace("%p, %p", pdata, extra); + + /* create pseudo-block */ + ENTER; + SAVETMPS; + + /* create the parser data hash */ + HV *phash = newHV(); + dummy = hv_store(phash, "suberror", 8, newSVuv(pdata->suberror), 0); + dummy = hv_store(phash, "linenum", 7, newSVuv(pdata->linenum), 0); + dummy = hv_store(phash, "line", 4, newSVpv(pdata->line, 0), 0); + dummy = hv_store(phash, "filename", 8, newSVpv(pdata->filename, 0), 0); + + /* create stack frame */ + PUSHMARK(SP); + + XPUSHs(sv_2mortal(newRV_noinc((SV *)phash))); + XPUSHs(callback_data); + + /* finalise stack frame */ + PUTBACK; + + /* call the object */ + n = call_sv(callback_func, G_SCALAR); + + /* refresh local stack pointer */ + SPAGAIN; + + /* delete the hash */ + hv_undef(phash); + + /* Make sure we got a scalar back; otherwise complain and abort */ + if (n != 1) { + croak("GetData: expected scalar response from parser callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } + + /* pop our return value */ + ret = POPs; + + /* de-reference as needed */ + while (SvROK(ret)) { + ret = SvRV(ret); + was_rv = 1; + } + + /* ferret out response */ + switch (SvTYPE(ret)) { + AV *av; + int len; + + case SVt_IV: + sem = SvIV(ret); + break; + case SVt_PVAV: + av = (AV *)ret; + len = av_len(av); + if (len < 0) { + croak("GetData: parser callback returned empty array."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } else if (len > 1) { + croak("GetData: too many elements in array returned by parser " + "callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } else if (len == 0) { + SV **val = av_fetch(av, 0, 0); + if (val == NULL || SvROK(*val)) { + croak("GetData: bad data type in array returned by parser callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } + + if (SvTYPE(*val) == SVt_IV) { + sem = SvIV(*val); + } else if (SvTYPE(*val) == SVt_PV) { + pdata->line = strdup(SvPV_nolen(*val)); + sem = GD_SYNTAX_RESCAN; + } else { + croak("GetData: bad data type in array returned by parser callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } + } else { /* len == 1 */ + SV **val0 = av_fetch(av, 0, 0); + SV **val1 = av_fetch(av, 1, 0); + + if (val0 == NULL || SvROK(*val0) || val1 == NULL || SvROK(*val1)) { + croak("GetData: bad data type in array returned by parser callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } + + if (SvTYPE(*val0) == SVt_IV && SvTYPE(*val1) == SVt_PV) { + sem = SvIV(*val0); + pdata->line = strdup(SvPV_nolen(*val1)); + } else { + croak("GetData: bad data type in array returned by parser callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } + } + break; + case SVt_PV: + pdata->line = strdup(SvPV_nolen(ret)); + sem = GD_SYNTAX_RESCAN; + break; + default: + croak("GetData: bad data type returned by parser callback."); + return GD_SYNTAX_ABORT; /* ca'n't get here */ + } + + /* resync global stack pointer */ + PUTBACK; + + /* destroy pseudo-block */ + FREETMPS; + LEAVE; + + dreturn("%i", sem); + return sem; +} + +#define GDP_UNPACKU(t) \ + if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSVuv(((t*)data)[i]))); \ + else for (i = 0; i < n; ++i) av_store(av, i, newSVuv(((t*)data)[i])); + +#define GDP_UNPACKI(t) \ + if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSViv(((t*)data)[i]))); \ + else for (i = 0; i < n; ++i) av_store(av, i, newSViv(((t*)data)[i])); + +#define GDP_UNPACKN(t) \ + if (sp) for (i = 0; i < n; ++i) XPUSHs(sv_2mortal(newSVnv(((t*)data)[i]))); \ + else for (i = 0; i < n; ++i) av_store(av, i, newSVnv(((t*)data)[i])); + +#define GDP_UNPACKC(t) \ + if (sp) for (i = 0; i < n; ++i) \ + XPUSHs(sv_2mortal(gdp_newSVcmp(((t*)data)[i]))); \ + else for (i = 0; i < n; ++i) av_store(av, i, gdp_newSVcmp(((t*)data)[i])); + +/* unpack data. If sp is NULL, return an AV, otherwise push it onto the perl + * stack; returns the updated stack pointer */ +static void * gdp_unpack(SV **sp, const void *data, size_t n, gd_type_t type) +{ + dtrace("%p, %p, %zi, %03x", sp, data, n, type); + size_t i; + AV *av = NULL; + + if (!sp) { + av = newAV(); + av_extend(av, n - 1); + } + + if (n == 0) { + dreturn("%p", sp); + return sp ? (void *)sp : (void *)av; + } + + switch (type) { + case GD_UINT8: + GDP_UNPACKU(uint8_t); + break; + case GD_INT8: + GDP_UNPACKI(int8_t); + break; + case GD_UINT16: + GDP_UNPACKU(uint16_t); + break; + case GD_INT16: + GDP_UNPACKI(int16_t); + break; + case GD_UINT32: + GDP_UNPACKU(uint32_t); + break; + case GD_INT32: + GDP_UNPACKI(int32_t); + break; + case GD_UINT64: + GDP_UNPACKU(uint64_t); + break; + case GD_INT64: + GDP_UNPACKI(int64_t); + break; + case GD_FLOAT32: + GDP_UNPACKN(float); + break; + case GD_FLOAT64: + GDP_UNPACKN(double); + break; + case GD_COMPLEX64: + GDP_UNPACKC(complex float); + break; + case GD_COMPLEX128: + GDP_UNPACKC(complex double); + break; + case GD_UNKNOWN: + case GD_NULL: + break; + } + + dreturn("%p", sp ? (void *)sp : (void *)av); + return sp ? (void *)sp : (void *)av; +} + +/* Module starts here --------------------------------------------------- */ +MODULE = GetData PACKAGE = GetData +PROTOTYPES: ENABLE + +BOOT: + gdp_invalid = gd_invalid_dirfile(); + +void +DESTROY(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::DESTROY = 1 + CODE: + dtrace("%p", dirfile); + if (dirfile != gdp_invalid) + gd_discard(dirfile); + safefree(gdp_dirfile); + CLEANUP: + dreturnvoid(); + +int +error(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::error = 1 + CODE: + dtrace("%p", dirfile); + + RETVAL = gd_error(dirfile); + OUTPUT: + RETVAL + CLEANUP: + dreturn("%i", RETVAL); + + +DIRFILE * +open(dirfilename, flags, sehandler=undef, extra=undef) + const char * dirfilename + unsigned long flags + SV * sehandler + SV * extra + PREINIT: + struct gdp_dirfile_t *gdp_dirfile = + (struct gdp_dirfile_t *)safemalloc(sizeof(struct gdp_dirfile_t)); + CODE: + dtrace("\"%s\", %lu, %p, %p", dirfilename, flags, sehandler, extra); + if (sehandler == undef) { + gdp_dirfile->cbdata.func = NULL; + gdp_dirfile->cbdata.data = NULL; + + RETVAL = gd_cbopen(dirfilename, flags, NULL, NULL); + } else { + gdp_dirfile->cbdata.func = sehandler; + gdp_dirfile->cbdata.data = extra; + + RETVAL = gd_cbopen(dirfilename, flags, gdp_parser_callback, + &gdp_dirfile->cbdata); + } + OUTPUT: + RETVAL + CLEANUP: + dreturn("%p", gdp_dirfile); + +DIRFILE * +invalid_dirfile() + PREINIT: + struct gdp_dirfile_t *gdp_dirfile = + (struct gdp_dirfile_t *)safemalloc(sizeof(struct gdp_dirfile_t)); + CODE: + dtracevoid(); + gdp_dirfile->cbdata.func = NULL; + gdp_dirfile->cbdata.data = NULL; + + RETVAL = gd_invalid_dirfile(); + OUTPUT: + RETVAL + CLEANUP: + dreturn("%p", gdp_dirfile); + +void +get_carray(dirfile, field_code, return_type) + DIRFILE * dirfile + const char * field_code + gd_type_t return_type + PREINIT: + void *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::get_carray = 1 + PPCODE: + dtrace("%p, \"%s\", %03x; %lu", dirfile, field_code, return_type, + GIMME_V); + size_t len = gd_carray_len(dirfile, field_code); + data_out = safemalloc(GD_SIZE(return_type) * len); + gd_get_carray(dirfile, field_code, return_type, data_out); + + GDP_UNDEF_ON_ERROR(safefree(data_out)); + + if (GIMME_V == G_ARRAY) + sp = (SV **)gdp_unpack(sp, data_out, len, return_type); + else + XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); + + safefree(data_out); + dreturnvoid(); + +void +get_carray_slice(dirfile, field_code, start, len, return_type) + DIRFILE * dirfile + const char * field_code + gd_type_t return_type + unsigned int start + size_t len + PREINIT: + void *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::get_carray_slice = 1 + PPCODE: + dtrace("%p, \"%s\", %u, %zi, %03x; %lu", dirfile, field_code, return_type, + start, len, GIMME_V); + data_out = safemalloc(GD_SIZE(return_type) * len); + gd_get_carray_slice(dirfile, field_code, start, len, return_type, data_out); + + GDP_UNDEF_ON_ERROR(safefree(data_out)); + + if (GIMME_V == G_ARRAY) + sp = (SV **)gdp_unpack(sp, data_out, len, return_type); + else + XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); + + safefree(data_out); + dreturnvoid(); + +SV * +get_constant(dirfile, field_code, return_type) + DIRFILE * dirfile + const char * field_code + gd_type_t return_type + PREINIT: + void *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::get_constant = 1 + CODE: + gd_type_t type; + dtrace("%p, \"%s\", %03x", dirfile, field_code, return_type); + data_out = safemalloc(16); + + if (return_type & GD_COMPLEX) + type = GD_COMPLEX128; + else if (return_type & GD_IEEE754) + type = GD_FLOAT64; + else if (return_type & GD_SIGNED) + type = GD_INT64; + else + type = GD_UINT64; + + gd_get_constant(dirfile, field_code, type, data_out); + + GDP_UNDEF_ON_ERROR(safefree(data_out)); + + if (type == GD_COMPLEX128) + RETVAL = gdp_newSVcmp(*(complex double*)data_out); + else if (type == GD_FLOAT64) + RETVAL = newSVnv(*(double*)data_out); + else if (type == GD_INT64) + RETVAL = newSViv(*(int64_t*)data_out); + else + RETVAL = newSVuv(*(uint64_t*)data_out); + OUTPUT: + RETVAL + CLEANUP: + safefree(data_out); + dreturn("%p", RETVAL); + +void +constants(dirfile, return_type) + DIRFILE * dirfile + gd_type_t return_type + PREINIT: + const void *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::constants = 1 + PPCODE: + dtrace("%p, %03x; %lu", dirfile, return_type, GIMME_V); + int len = gd_nfields_by_type(dirfile, GD_CONST_ENTRY); + data_out = gd_constants(dirfile, return_type); + + GDP_UNDEF_ON_ERROR(); + + if (GIMME_V == G_ARRAY) + sp = (SV **)gdp_unpack(sp, data_out, len, return_type); + else + XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); + + dreturnvoid(); + +void +carrays(dirfile, return_type) + DIRFILE * dirfile + gd_type_t return_type + PREINIT: + const gd_carray_t *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::carrays = 1 + PPCODE: + dtrace("%p, %03x; %lu", dirfile, return_type, GIMME_V); + I32 i, len = (I32)gd_nfields_by_type(dirfile, GD_CARRAY_ENTRY); + data_out = gd_carrays(dirfile, return_type); + + GDP_UNDEF_ON_ERROR(); + + /* in array context, return an array of arrays of unpacked data. + * Otherwise, return a reference to an array of packed data. */ + if (GIMME_V == G_ARRAY) + for (i = 0; i < len; ++i) + XPUSHs(sv_2mortal(newRV_noinc((SV *)gdp_unpack(NULL, data_out[i].d, + data_out[i].n, return_type)))); + else { + AV *av = newAV(); + for (i = 0; i < len; ++i) + av_store(av, i, newSVpvn(data_out[i].d, + data_out[i].n * GD_SIZE(return_type))); + XPUSHs(sv_2mortal(newRV_noinc((SV*)av))); + } + + dreturnvoid(); + +void +entry(dirfile, field_code) + DIRFILE * dirfile + const char * field_code + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::entry = 1 + PPCODE: + dtrace("%p, \"%s\"; %lu", dirfile, field_code, GIMME_V); + + if (GIMME_V == G_ARRAY) { + gd_entry_t E; + gd_entry(dirfile, field_code, &E); + + GDP_UNDEF_ON_ERROR(); + + /* push the hash onto the stack */ + GDP_PUSHpvn("field"); + GDP_PUSHpvz(E.field); + GDP_PUSHpvn("field_type"); + GDP_PUSHuv(E.field_type); + GDP_PUSHpvn("fragment_index"); + GDP_PUSHuv(E.fragment_index); + switch (E.field_type) { + case GD_BIT_ENTRY: + case GD_SBIT_ENTRY: + GDP_PUSHpvn("in_field"); + GDP_PUSHpvz(E.in_fields[0]); + GDP_PUSHpvn("bitnum"); + GDP_PUSHuv(E.bitnum); + GDP_PUSHpvn("numbits"); + GDP_PUSHuv(E.numbits); + sp = gdp_store_scalars(sp, &E, 0x3); + break; + case GD_CARRAY_ENTRY: + GDP_PUSHpvn("array_len"); + GDP_PUSHuv(E.array_len); + /* fallthrough */ + case GD_CONST_ENTRY: + GDP_PUSHpvn("const_type"); + GDP_PUSHuv(E.const_type); + break; + case GD_LINCOM_ENTRY: + GDP_PUSHpvn("n_fields"); + GDP_PUSHiv(E.n_fields); + GDP_PUSHpvn("in_fields"); + GDP_PUSHrvavpv(E.in_fields, E.n_fields); + GDP_PUSHpvn("m"); + GDP_PUSHrvavcmp(E.cm, E.n_fields); + GDP_PUSHpvn("b"); + GDP_PUSHrvavcmp(E.cb, E.n_fields); + sp = gdp_store_scalars(sp, &E, ((1 << E.n_fields) - 1) * 9); + break; + case GD_LINTERP_ENTRY: + GDP_PUSHpvn("in_field"); + GDP_PUSHpvz(E.in_fields[0]); + GDP_PUSHpvn("table"); + GDP_PUSHpvz(E.table); + break; + case GD_MULTIPLY_ENTRY: + case GD_DIVIDE_ENTRY: + GDP_PUSHpvn("in_fields"); + GDP_PUSHrvavpv(E.in_fields, 2); + break; + case GD_PHASE_ENTRY: + GDP_PUSHpvn("in_field"); + GDP_PUSHpvz(E.in_fields[0]); + GDP_PUSHpvn("shift"); + GDP_PUSHiv(E.shift); + sp = gdp_store_scalars(sp, &E, 1); + break; + case GD_POLYNOM_ENTRY: + GDP_PUSHpvn("poly_ord"); + GDP_PUSHiv(E.poly_ord); + GDP_PUSHpvn("in_field"); + GDP_PUSHpvz(E.in_fields[0]); + GDP_PUSHpvn("a"); + GDP_PUSHrvavcmp(E.ca, E.poly_ord + 1); + sp = gdp_store_scalars(sp, &E, (1 << (E.poly_ord + 1)) - 1); + break; + case GD_RECIP_ENTRY: + GDP_PUSHpvn("in_field"); + GDP_PUSHpvz(E.in_fields[0]); + GDP_PUSHpvn("dividend"); + GDP_PUSHcmp(E.cdividend); + sp = gdp_store_scalars(sp, &E, 1); + break; + case GD_RAW_ENTRY: + GDP_PUSHpvn("spf"); + GDP_PUSHuv(E.spf); + GDP_PUSHpvn("data_type"); + GDP_PUSHuv(E.data_type); + sp = gdp_store_scalars(sp, &E, 1); + break; + case GD_INDEX_ENTRY: + case GD_STRING_ENTRY: + case GD_NO_ENTRY: + break; + } + + gd_free_entry_strings(&E); + } else { + gd_entype_t t = gd_entry_type(dirfile, field_code); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHiv(t); + } + dreturnvoid(); + +SV * +error_string(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::error_string = 1 + CODE: + dtrace("%p", dirfile); + char *s = gd_error_string(dirfile, NULL, 0); + + RETVAL = newSVpv(s, 0); + OUTPUT: + RETVAL + CLEANUP: + free(s); + dreturn("%p", RETVAL); + +AV * +mcarrays(dirfile, parent, return_type, unpacked=0) + DIRFILE * dirfile + const char * parent; + gd_type_t return_type + IV unpacked + PREINIT: + const gd_carray_t *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::mcarrays = 1 + CODE: + dtrace("%p, %03x, %i", dirfile, return_type, (int)unpacked); + I32 i, len = (I32)gd_nmfields_by_type(dirfile, parent, GD_CARRAY_ENTRY); + data_out = gd_mcarrays(dirfile, parent, return_type); + + GDP_UNDEF_ON_ERROR(); + + RETVAL = newAV(); + for (i = 0; i < len; ++i) + av_store(RETVAL, i, newSVpvn(data_out[i].d, + data_out[i].n * GD_SIZE(return_type))); + OUTPUT: + RETVAL + CLEANUP: + dreturn("%p", RETVAL); + +void +mconstants(dirfile, parent, return_type) + DIRFILE * dirfile + const char * parent + gd_type_t return_type + PREINIT: + const void *data_out = NULL; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::mconstants = 1 + PPCODE: + dtrace("%p, %03x; %lu", dirfile, return_type, GIMME_V); + int len = gd_nmfields_by_type(dirfile, parent, GD_CONST_ENTRY); + data_out = gd_mconstants(dirfile, parent, return_type); + + GDP_UNDEF_ON_ERROR(); + + if (GIMME_V == G_ARRAY) + sp = (SV **)gdp_unpack(sp, data_out, len, return_type); + else + XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); + + dreturnvoid(); + +void +parser_callback(dirfile, sehandler, extra=undef) + DIRFILE * dirfile + SV *sehandler + SV *extra + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::parser_callback = 1 + CODE: + dtrace("%p, %p, %p", dirfile, sehandler, extra); + if (sehandler == undef) { + gdp_dirfile->cbdata.func = NULL; + gdp_dirfile->cbdata.data = NULL; + + gd_parser_callback(dirfile, NULL, NULL); + } else { + gdp_dirfile->cbdata.func = sehandler; + gdp_dirfile->cbdata.data = extra; + + gd_parser_callback(dirfile, gdp_parser_callback, &gdp_dirfile->cbdata); + } + CLEANUP: + dreturnvoid(); + +char * +get_string(dirfile, field_code) + DIRFILE * dirfile + const char * field_code + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::get_string = 1 + CODE: + dtrace("%p, \"%s\"", dirfile, field_code); + + /* get string length */ + size_t len = gd_get_string(dirfile, field_code, 0, NULL); + RETVAL = safemalloc(len); + + /* get string */ + gd_get_string(dirfile, field_code, len, RETVAL); + OUTPUT: + RETVAL + CLEANUP: + dreturn("\"%s\"", RETVAL); + safefree(RETVAL); + +int +close(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::close = 1 + CODE: + dtrace("%p", dirfile); + + if (dirfile != gdp_invalid) { + RETVAL = gd_close(dirfile); + + if (!RETVAL) + gdp_dirfile->D = NULL; + } else + RETVAL = 0; + OUTPUT: + RETVAL + CLEANUP: + dreturn("%i", RETVAL); + +int +discard(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::discard = 1 + CODE: + dtrace("%p", dirfile); + + if (dirfile != gdp_invalid) { + RETVAL = gd_discard(dirfile); + + if (!RETVAL) + gdp_dirfile->D = NULL; + } else + RETVAL = 0; + OUTPUT: + RETVAL + CLEANUP: + dreturn("%i", RETVAL); + +void +getdata(dirfile, field_code, first_frame, first_samp, num_frames, num_samp, return_type) + DIRFILE * dirfile + const char * field_code + off64_t first_frame + off64_t first_samp + size_t num_frames + size_t num_samp + gd_type_t return_type + PREINIT: + void *data_out = NULL; + gd_spf_t spf = 1; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::getdata = 1 + PPCODE: + dtrace("%p, \"%s\", %lli, %lli, %zi, %zi, %03x; %lu", dirfile, field_code, + (long long)first_frame, (long long)first_samp, num_frames, num_samp, + return_type, GIMME_V); + + if (num_frames) { + spf = gd_spf(dirfile, field_code); + + GDP_UNDEF_ON_ERROR(); + } + + data_out = safemalloc(GD_SIZE(return_type) * (spf * num_frames + num_samp)); + + size_t len = gdp64(gd_getdata)(dirfile, field_code, first_frame, first_samp, + num_frames, num_samp, return_type, data_out); + + GDP_UNDEF_ON_ERROR(safefree(data_out)); + + /* In array context, unpack the array and push it onto the stack, otherwise + * just return the packed data */ + if (GIMME_V == G_ARRAY) + sp = (SV **)gdp_unpack(sp, data_out, len, return_type); + else + XPUSHs(sv_2mortal(newSVpvn(data_out, len * GD_SIZE(return_type)))); + + safefree(data_out); + dreturnvoid(); + +void +field_list(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::field_list = 1 + PPCODE: + dtrace("%p; %lu", dirfile, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_field_list(dirfile); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nfields(dirfile); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +field_list_by_type(dirfile, type) + DIRFILE * dirfile + gd_entype_t type + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::field_list_by_type = 1 + PPCODE: + dtrace("%p, %i; %lu", dirfile, type, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_field_list_by_type(dirfile, type); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nfields_by_type(dirfile, type); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +vector_list(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::vector_list = 1 + PPCODE: + dtrace("%p; %lu", dirfile, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_vector_list(dirfile); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nvectors(dirfile); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +strings(dirfile) + DIRFILE * dirfile + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::strings = 1 + PPCODE: + dtrace("%p; %lu", dirfile, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_strings(dirfile); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nfields_by_type(dirfile, GD_STRING_ENTRY); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +mfield_list(dirfile, field_code) + DIRFILE * dirfile + const char * field_code + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::mfield_list = 1 + PPCODE: + dtrace("%p, \"%s\"; %lu", dirfile, field_code, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_mfield_list(dirfile, field_code); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nmfields(dirfile, field_code); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +mfield_list_by_type(dirfile, parent, type) + DIRFILE * dirfile + const char * parent + gd_entype_t type + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::mfield_list_by_type = 1 + PPCODE: + dtrace("%p, \"%s\", %i; %lu", dirfile, parent, type, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_mfield_list_by_type(dirfile, parent, type); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nmfields_by_type(dirfile, parent, type); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +mvector_list(dirfile, parent) + DIRFILE * dirfile + const char * parent + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::mvector_list = 1 + PPCODE: + dtrace("%p; %lu", dirfile, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_mvector_list(dirfile, parent); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nmvectors(dirfile, parent); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +void +mstrings(dirfile, field_code) + DIRFILE * dirfile + const char * field_code + PREINIT: + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::mstrings = 1 + PPCODE: + dtrace("%p, \"%s\"; %lu", dirfile, field_code, GIMME_V); + + /* in array context, return the field list, otherwise return nfields */ + if (GIMME_V == G_ARRAY) { + int i; + const char **fl = gd_mstrings(dirfile, field_code); + + GDP_UNDEF_ON_ERROR(); + + for (i = 0; fl[i]; ++i) + GDP_PUSHpvz(fl[i]); + } else { + unsigned int nf = gd_nmfields_by_type(dirfile, field_code, + GD_STRING_ENTRY); + + GDP_UNDEF_ON_ERROR(); + + GDP_PUSHuv(nf); + } + + dreturnvoid(); + +int +put_carray(dirfile, field_code, d, ...) + DIRFILE * dirfile + const char * field_code + SV *d; + PREINIT: + GDP_DIRFILE_ALIAS; + struct gdp_din din; + ALIAS: + GetData::Dirfile::put_carray = 1 + CODE: + dtrace("%p, \"%s\", %p, ...[%li]", dirfile, field_code, d, items - 3); + + din = gdp_convert_data(d, items, ax, 2, gdp_package, "put_carray"); + + RETVAL = gd_put_carray(dirfile, field_code, din.type, din.data_in); + + GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in)); + OUTPUT: + RETVAL + CLEANUP: + if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in); + dreturn("%i", RETVAL); + +int +put_carray_slice(dirfile, field_code, start, d, ...) + DIRFILE * dirfile + const char * field_code + off64_t start + SV *d; + PREINIT: + GDP_DIRFILE_ALIAS; + struct gdp_din din; + ALIAS: + GetData::Dirfile::put_carray_slice = 1 + CODE: + dtrace("%p, \"%s\", %lli, %p, ...[%li]", dirfile, field_code, + (long long)start, d, items - 4); + + din = gdp_convert_data(d, items, ax, 3, gdp_package, "put_carray"); + + RETVAL = gd_put_carray_slice(dirfile, field_code, start, din.nsamp, + din.type, din.data_in); + + GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in)); + OUTPUT: + RETVAL + CLEANUP: + if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in); + +int +add_carray(dirfile, field_code, const_type, fragment_index, d, ...) + DIRFILE * dirfile + const char * field_code + int fragment_index + gd_type_t const_type + SV *d + PREINIT: + GDP_DIRFILE_ALIAS; + struct gdp_din din; + ALIAS: + GetData::Dirfile::add_carray = 1 + CODE: + dtrace("%p, \"%s\", %03x, %i, %p, ...[%li]", dirfile, field_code, + const_type, fragment_index, d, items - 5); + + din = gdp_convert_data(d, items, ax, 4, gdp_package, "put_carray"); + + RETVAL = gd_add_carray(dirfile, field_code, const_type, din.nsamp, + din.type, din.data_in, fragment_index); + + GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in)); + OUTPUT: + RETVAL + CLEANUP: + if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in); + dreturn("%i", RETVAL); + +int +madd_carray(dirfile, parent, field_code, const_type, d, ...) + DIRFILE * dirfile + const char * parent + const char * field_code + gd_type_t const_type + SV *d + PREINIT: + GDP_DIRFILE_ALIAS; + struct gdp_din din; + ALIAS: + GetData::Dirfile::madd_carray = 1 + CODE: + dtrace("%p, \"%s\", \"%s\", %03x, %p, ...[%li]", dirfile, parent, + field_code, const_type, d, items - 5); + + din = gdp_convert_data(d, items, ax, 4, gdp_package, "put_carray"); + + RETVAL = gd_madd_carray(dirfile, parent, field_code, const_type, din.nsamp, + din.type, din.data_in); + + GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in)); + OUTPUT: + RETVAL + CLEANUP: + if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in); + dreturn("%i", RETVAL); + +size_t +putdata(dirfile, field_code, first_frame, first_sample, d, ...) + DIRFILE * dirfile + const char * field_code + off64_t first_frame + off64_t first_sample + SV *d; + PREINIT: + GDP_DIRFILE_ALIAS; + struct gdp_din din; + ALIAS: + GetData::Dirfile::putdata = 1 + CODE: + dtrace("%p, \"%s\", %lli, %lli, %p, ...[%li]", dirfile, field_code, + (long long)first_frame, (long long)first_sample, d, items - 5); + + din = gdp_convert_data(d, items, ax, 4, gdp_package, "putdata"); + + RETVAL = gd_putdata(dirfile, field_code, first_frame, first_sample, 0, + din.nsamp, din.type, din.data_in); + + GDP_UNDEF_ON_ERROR(if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in)); + OUTPUT: + RETVAL + CLEANUP: + if (din.arg_type != GDP_DATA_IN_PACK) + safefree(din.data_in); + dreturn("%zi", RETVAL); + +int +add_const(dirfile, field_code, const_type, value=undef, fragment_index=0) + DIRFILE * dirfile + const char * field_code + gd_type_t const_type + SV * value + int fragment_index + PREINIT: + gd_type_t data_type; + char data_in[16]; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::add_const = 1 + CODE: + dtrace("%p, \"%s\", %03x, %p, %i", dirfile, field_code, const_type, value, + fragment_index); + + data_type = gdp_to_voidp(data_in, value, const_type, gdp_package, + "add_const"); + + RETVAL = gd_add_const(dirfile, field_code, const_type, data_type, data_in, + fragment_index); + + GDP_UNDEF_ON_ERROR(); + OUTPUT: + RETVAL + CLEANUP: + dreturn("%i", RETVAL); + +int +madd_const(dirfile, parent, field_code, const_type, value=undef) + DIRFILE * dirfile + const char * parent + const char * field_code + gd_type_t const_type + SV * value + PREINIT: + gd_type_t data_type; + char data_in[16]; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::madd_const = 1 + CODE: + dtrace("%p, \"%s\", \"%s\", %03x, %p", dirfile, parent, field_code, + const_type, value); + + data_type = gdp_to_voidp(data_in, value, const_type, gdp_package, + "madd_const"); + + RETVAL = gd_madd_const(dirfile, parent, field_code, const_type, data_type, + data_in); + + GDP_UNDEF_ON_ERROR(); + OUTPUT: + RETVAL + CLEANUP: + dreturn("%i", RETVAL); + +int +put_constant(dirfile, field_code, value) + DIRFILE * dirfile + const char * field_code + SV * value + PREINIT: + gd_type_t data_type; + char data_in[16]; + GDP_DIRFILE_ALIAS; + ALIAS: + GetData::Dirfile::put_constant = 1 + CODE: + dtrace("%p, \"%s\", %p", dirfile, field_code, value); + + data_type = gdp_to_voidp(data_in, value, GD_FLOAT64, gdp_package, + "put_constant"... [truncated message content] |
From: <ket...@us...> - 2011-04-03 11:19:49
|
Revision: 565 http://getdata.svn.sourceforge.net/getdata/?rev=565&view=rev Author: ketiltrout Date: 2011-04-03 11:19:43 +0000 (Sun, 03 Apr 2011) Log Message: ----------- tests for alter_[c]recip Added Paths: ----------- branches/getdata-0.7/test/alter_crecip_zero.c branches/getdata-0.7/test/alter_recip_zero.c Property Changed: ---------------- branches/getdata-0.7/test/ Property changes on: branches/getdata-0.7/test ___________________________________________________________________ Modified: svn:ignore - Makefile Makefile.in *.o *.odirfile *.swp *.exe .deps .libs convert_uint8_int8 convert_uint8_uint16 convert_uint8_int16 convert_uint8_uint32 convert_uint8_int32 convert_uint8_float32 convert_uint8_uint64 convert_uint8_int64 convert_uint8_float64 convert_int8_uint8 convert_int8_uint16 convert_int8_int16 convert_int8_uint32 convert_int8_int32 convert_int8_float32 convert_int8_uint64 convert_int8_int64 convert_int8_float64 convert_uint16_uint8 convert_uint16_int8 convert_uint16_int16 convert_uint16_uint32 convert_uint16_int32 convert_uint16_float32 convert_uint16_uint64 convert_uint16_int64 convert_uint16_float64 convert_int16_uint8 convert_int16_int8 convert_int16_uint16 convert_int16_uint32 convert_int16_int32 convert_int16_float32 convert_int16_uint64 convert_int16_int64 convert_int16_float64 convert_uint32_uint8 convert_uint32_int8 convert_uint32_uint16 convert_uint32_int16 convert_uint32_int32 convert_uint32_float32 convert_uint32_uint64 convert_uint32_int64 convert_uint32_float64 convert_int32_uint8 convert_int32_int8 convert_int32_uint16 convert_int32_int16 convert_int32_uint32 convert_int32_float32 convert_int32_uint64 convert_int32_int64 convert_int32_float64 convert_uint64_uint8 convert_uint64_int8 convert_uint64_uint16 convert_uint64_int16 convert_uint64_uint32 convert_uint64_int32 convert_uint64_float32 convert_uint64_int64 convert_uint64_float64 convert_int64_uint8 convert_int64_int8 convert_int64_uint16 convert_int64_int16 convert_int64_uint32 convert_int64_int32 convert_int64_float32 convert_int64_uint64 convert_int64_float64 convert_float32_uint8 convert_float32_int8 convert_float32_uint16 convert_float32_int16 convert_float32_uint32 convert_float32_int32 convert_float32_uint64 convert_float32_int64 convert_float32_float64 convert_float64_uint8 convert_float64_int8 convert_float64_uint16 convert_float64_int16 convert_float64_uint32 convert_float64_int32 convert_float64_float32 convert_float64_uint64 convert_float64_int64 creat creat_excl creat_rdonly flist flist_invalid get64 get_bad_code get_bit get_char get_endian8 get_endian16 get_endian32 get_endian64 get_endian_float32_big get_endian_float32_arm get_endian_float32_little get_endian_float64_big get_endian_float64_arm get_endian_float64_little get_ff get_float32 get_float64 get_foffs get_fs get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 get_lincom2 get_lincom3 get_lincom_noin get_linterp get_linterp_noin get_linterp_notab get_multiply get_multiply_noin get_nonexistent get_null get_off64 get_phase get_recurse get_sf get_ss get_type get_uint16 get_uint32 get_uint64 legacy_get legacy_nframes legacy_nonexistent legacy_put legacy_spf nfields nfields_invalid nframes nframes64 nframes_empty nframes_invalid nframes_off64 nframes_spf open open_eaccess open_nonexistent open_notdirfile parse_badline parse_bit parse_bit4 parse_bit_bitnum parse_bit_bitsize parse_bit_ncols parse_bit_numbits parse_endian_bad parse_endian_big parse_endian_force parse_endian_little parse_foffs parse_include parse_include_nonexistent parse_index parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 parse_lincom_nfields parse_lincom_nofields parse_linterp parse_linterp_ncols parse_multiply parse_multiply_ncols parse_ncols parse_phase parse_phase_ncols parse_raw parse_raw_char parse_raw_ncols parse_raw_spf parse_raw_type parse_version parse_version_include put64 put_bad_code put_bit put_bof put_char put_endian8 put_endian16 put_endian32 put_endian64 put_endian_float32_arm put_endian_float32_big put_endian_float32_little put_endian_float64_arm put_endian_float64_big put_endian_float64_little put_ff put_float32 put_float64 put_foffs put_fs put_int8 put_int16 put_int32 put_int64 put_invalid put_lincom1 put_lincom2 put_lincom_noin put_linterp put_linterp_notab put_multiply put_null put_off64 put_phase put_phase_noin put_rdonly put_recurse put_rofs put_sf put_ss put_type put_uint16 put_uint32 put_uint64 spf spf_lincom spf_multiply spf_recurse trunc trunc_rdonly trunc_rofs flush_invalid parse_version_slash flush_all flush close_null close parse_endian_slash error_error parse_name parse_include_slash close_bad parse_foffs_slash flush_bad_code dfes_bit dfes_lincom dfes_linterp dfes_multiply dfes_null dfes_phase dfes_raw dfes_zero entry_bad_code entry_bit entry_invalid entry_lincom entry_linterp entry_multiply entry_phase entry_raw legacy_get_put legacy_get_rofs add_phase add_lincom_nfields add_raw add_multiply add_bit_bitsize flush_meta add_type add_raw_type add_bit_bitnum add_bit add_format add_raw_spf put_linterp_noin error_short error add add_linterp nfragments add_duplicate add_code add_bit_numbits add_lincom add_rdonly ascii_get ascii_put ascii_nframes slim_get slim_nframes slim_put add_many add_sort nfields_type nfields_type_invalid nmeta nmeta_invalid nmeta_parent nmeta_type nmeta_type_invalid nmeta_type_parent nmeta_vectors nmeta_vectors_invalid nmeta_vectors_parent nvectors nvectors_invalid parse_const parse_const_ncols parse_duplicate parse_meta parse_meta_parent parse_meta_raw parse_quote parse_sort parse_string parse_string_ncols parse_whitespace madd_linterp_invalid madd_lincom_invalid vlist_invalid vlist_meta add_raw_invalid cvlist_invalid svlist_invalid cvlist svlist madd_phase_invalid add_invalid madd_phase add_phase_invalid add_spec_directive add_string add_linterp_invalid madd_multiply flist_type_invalid clist cvlist_meta_invalid flist_meta_invalid flist_type svlist_meta_invalid cvlist_meta vlist_meta_invalid svlist_meta parse_string_null madd_linterp madd_lincom vlist add_bit_invalid add_lincom_invalid madd_bit_invalid madd_bit add_multiply_invalid add_const madd_multiply_invalid madd add_spec_invalid flist_type_meta_invalid add_spec flist_type_meta flist_meta parse_meta_index entry_raw_scalar_code parse_bit_scalar entry_raw_scalar_type entry_lincom_scalar entry_phase_scalar entry_raw_scalar parse_lincom_scalar entry_bit_scalar parse_raw_scalar parse_phase_scalar include include_nonexistent include_creat include_invalid include_accmode include_index madd_spec_directive madd_spec_invalid madd_spec parse_quote_mismatch parse_eol parse_foffs_include put_string parse_protect_data put_const put_string_protect ref put_const_protect parse_protect_all ref_none parse_ref add_protect parse_protect_format parse_protect_bad ref_two put_protect include_rdonly parse_ref_nonexistent parse_protect_none parse_name_pedantic parse_name_dot parse_name_ext parse_duplicate_ignore gzip_get gzip_nframes gzip_put gzip_get_get bzip_get bzip_nframes bzip_put bzip_get_get global_name open_cb_abort open_cb_cont open_cb_ignore open_cb_rescan open_cb_invalid del_const_force del_const del_derived_force del_const_deref del_meta_force del_data del_meta del del_derived close_discard global_ref_set global_ref_empty include_ignore global_ref include_ref include_auto move move_index move_protect move_data_enc_ar bzip_move_from gzip_move_from move_data_foffs move_data_enc_ra move_data_endian move_data_nop alter_multiply alter_bit_bitnum alter_entry_recode alter_linterp_move alter_raw_spf alter_entry alter_bit_numbits alter_lincom_slope alter_raw_type alter_lincom_input alter_const alter_phase alter_lincom_offset alter_linterp foffs_get foffs_move foffs_alter endian_alter endian_move endian_get encode_alter encode_get encode_move protect_alter move_subdir unclude_del name_move unclude file name file_type unclude_move file_code parent protect_get global_ref_get alter_mspec alter_spec include_cb include_pc include_syntax fragment_index fragment_name fragment_name_oor entry_type alter_polynom_coeff get_polynom_noin get_polynom put_polynom_noin madd_polynom parse_polynom_scalar alter_polynom_ord parse_polynom spf_polynom entry_polynom_scalar put_polynom1 put_polynom2 parse_polynom_ncols1 parse_polynom_ncols2 alter_polynom_input add_polynom entry_polynom parse_lincom_non_ncols parse_lincom_non get_lincom_non xz_get xz_nframes lzma_get lzma_nframes add_sbit parse_sbit put_sbit get_sbit madd_sbit flush_spec index_domain madd_clincom index madd_const index_range add_clincom add_cpolynom get_clincom convert_float32_complex64 convert_int32_complex128 get_endian_complex128_big get_endian_complex128_arm get_endian_complex128_little convert_complex64_float64 parse_meta_index2 convert_uint16_complex128 put_endian_complex64_arm put_endian_complex64_big put_endian_complex64_little convert_uint16_complex64 convert_float64_complex128 repr_int8 convert_complex64_int64 convert_uint64_complex64 convert_complex64_complex128 get_const convert_uint8_complex128 parse_meta_implicit2 convert_float32_complex128 get_complex64 add_spec_meta convert_float64_complex64 convert_int16_complex128 alter_cpolynom madd_cpolynom convert_int32_complex64 alter_lincom_23 convert_complex64_uint64 repr_uint8 put_complex128 get_endian_complex64_big get_endian_complex64_arm get_endian_complex64_little alter_spec_meta repr_real_a repr_real_i repr_real_m repr_real_r repr_int16 convert_uint8_complex64 repr_int32 madd_string convert_complex128_float64 repr_uint16 repr_int64 put_endian_complex128_arm put_endian_complex128_big put_endian_complex128_little get_complex128 repr_uint32 convert_complex128_uint64 get_const_repr convert_complex128_int64 repr_float32 repr_uint64 convert_int16_complex64 repr_float64 put_complex64 convert_uint64_complex128 convert_int64_complex64 repr_a repr_i repr_m repr_r get_const_complex convert_int8_complex128 convert_uint32_complex128 parse_meta_implicit get_cpolynom put_repr convert_complex128_complex64 convert_int8_complex64 convert_uint32_complex64 convert_int64_complex128 move_meta add_scalar alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 alter_entry_scalar4 get_zero entry_scalar_repr header_complex version_5_strict parse_version_permissive version_7_strict version_0 version_1 version_2 version_3 version_4 version_5 version_6 version_7 version_6_strict eof eof_index eof_lincom eof_phase bof bof_lincom bof_phase put_linterp_nomono get_linterp_sort put_linterp_reverse alter_lincom_32 parse_recip parse_divide alter_recip dfes_recip add_crecip89 add_divide put_divide madd_recip add_crecip get_recip_const spf_divide add_divide_invalid version_8 alter_crecip89 put_recip spf_recip madd_crecip89 alter_divide get_recip alter_crecip madd_divide dfes_divide madd_crecip add_recip get_divide version_8_strict version_5_write version_0_write version_7_write version_2_write version_4_write version_6_write version_1_write version_8_write version_3_write put_carray_slice cvlist_array_meta del_carray get_carray_slice cvlist_array del_carray_deref nmeta_vectors_del get_carray parse_carray madd_carray add_carray put_carray get_carray_len parse_carray_long alter_carray_len alter_carray_type ascii_get_get parse_include_relabs parse_include_absrel parse_include_relrel parse_include_absolute add_raw_include + Makefile Makefile.in *.o *.odirfile *.swp *.exe .deps .libs convert_uint8_int8 convert_uint8_uint16 convert_uint8_int16 convert_uint8_uint32 convert_uint8_int32 convert_uint8_float32 convert_uint8_uint64 convert_uint8_int64 convert_uint8_float64 convert_int8_uint8 convert_int8_uint16 convert_int8_int16 convert_int8_uint32 convert_int8_int32 convert_int8_float32 convert_int8_uint64 convert_int8_int64 convert_int8_float64 convert_uint16_uint8 convert_uint16_int8 convert_uint16_int16 convert_uint16_uint32 convert_uint16_int32 convert_uint16_float32 convert_uint16_uint64 convert_uint16_int64 convert_uint16_float64 convert_int16_uint8 convert_int16_int8 convert_int16_uint16 convert_int16_uint32 convert_int16_int32 convert_int16_float32 convert_int16_uint64 convert_int16_int64 convert_int16_float64 convert_uint32_uint8 convert_uint32_int8 convert_uint32_uint16 convert_uint32_int16 convert_uint32_int32 convert_uint32_float32 convert_uint32_uint64 convert_uint32_int64 convert_uint32_float64 convert_int32_uint8 convert_int32_int8 convert_int32_uint16 convert_int32_int16 convert_int32_uint32 convert_int32_float32 convert_int32_uint64 convert_int32_int64 convert_int32_float64 convert_uint64_uint8 convert_uint64_int8 convert_uint64_uint16 convert_uint64_int16 convert_uint64_uint32 convert_uint64_int32 convert_uint64_float32 convert_uint64_int64 convert_uint64_float64 convert_int64_uint8 convert_int64_int8 convert_int64_uint16 convert_int64_int16 convert_int64_uint32 convert_int64_int32 convert_int64_float32 convert_int64_uint64 convert_int64_float64 convert_float32_uint8 convert_float32_int8 convert_float32_uint16 convert_float32_int16 convert_float32_uint32 convert_float32_int32 convert_float32_uint64 convert_float32_int64 convert_float32_float64 convert_float64_uint8 convert_float64_int8 convert_float64_uint16 convert_float64_int16 convert_float64_uint32 convert_float64_int32 convert_float64_float32 convert_float64_uint64 convert_float64_int64 creat creat_excl creat_rdonly flist flist_invalid get64 get_bad_code get_bit get_char get_endian8 get_endian16 get_endian32 get_endian64 get_endian_float32_big get_endian_float32_arm get_endian_float32_little get_endian_float64_big get_endian_float64_arm get_endian_float64_little get_ff get_float32 get_float64 get_foffs get_fs get_int8 get_int16 get_int32 get_int64 get_invalid get_lincom1 get_lincom2 get_lincom3 get_lincom_noin get_linterp get_linterp_noin get_linterp_notab get_multiply get_multiply_noin get_nonexistent get_null get_off64 get_phase get_recurse get_sf get_ss get_type get_uint16 get_uint32 get_uint64 legacy_get legacy_nframes legacy_nonexistent legacy_put legacy_spf nfields nfields_invalid nframes nframes64 nframes_empty nframes_invalid nframes_off64 nframes_spf open open_eaccess open_nonexistent open_notdirfile parse_badline parse_bit parse_bit4 parse_bit_bitnum parse_bit_bitsize parse_bit_ncols parse_bit_numbits parse_endian_bad parse_endian_big parse_endian_force parse_endian_little parse_foffs parse_include parse_include_nonexistent parse_index parse_lincom parse_lincom_ncols1 parse_lincom_ncols2 parse_lincom_nfields parse_lincom_nofields parse_linterp parse_linterp_ncols parse_multiply parse_multiply_ncols parse_ncols parse_phase parse_phase_ncols parse_raw parse_raw_char parse_raw_ncols parse_raw_spf parse_raw_type parse_version parse_version_include put64 put_bad_code put_bit put_bof put_char put_endian8 put_endian16 put_endian32 put_endian64 put_endian_float32_arm put_endian_float32_big put_endian_float32_little put_endian_float64_arm put_endian_float64_big put_endian_float64_little put_ff put_float32 put_float64 put_foffs put_fs put_int8 put_int16 put_int32 put_int64 put_invalid put_lincom1 put_lincom2 put_lincom_noin put_linterp put_linterp_notab put_multiply put_null put_off64 put_phase put_phase_noin put_rdonly put_recurse put_rofs put_sf put_ss put_type put_uint16 put_uint32 put_uint64 spf spf_lincom spf_multiply spf_recurse trunc trunc_rdonly trunc_rofs flush_invalid parse_version_slash flush_all flush close_null close parse_endian_slash error_error parse_name parse_include_slash close_bad parse_foffs_slash flush_bad_code dfes_bit dfes_lincom dfes_linterp dfes_multiply dfes_null dfes_phase dfes_raw dfes_zero entry_bad_code entry_bit entry_invalid entry_lincom entry_linterp entry_multiply entry_phase entry_raw legacy_get_put legacy_get_rofs add_phase add_lincom_nfields add_raw add_multiply add_bit_bitsize flush_meta add_type add_raw_type add_bit_bitnum add_bit add_format add_raw_spf put_linterp_noin error_short error add add_linterp nfragments add_duplicate add_code add_bit_numbits add_lincom add_rdonly ascii_get ascii_put ascii_nframes slim_get slim_nframes slim_put add_many add_sort nfields_type nfields_type_invalid nmeta nmeta_invalid nmeta_parent nmeta_type nmeta_type_invalid nmeta_type_parent nmeta_vectors nmeta_vectors_invalid nmeta_vectors_parent nvectors nvectors_invalid parse_const parse_const_ncols parse_duplicate parse_meta parse_meta_parent parse_meta_raw parse_quote parse_sort parse_string parse_string_ncols parse_whitespace madd_linterp_invalid madd_lincom_invalid vlist_invalid vlist_meta add_raw_invalid cvlist_invalid svlist_invalid cvlist svlist madd_phase_invalid add_invalid madd_phase add_phase_invalid add_spec_directive add_string add_linterp_invalid madd_multiply flist_type_invalid clist cvlist_meta_invalid flist_meta_invalid flist_type svlist_meta_invalid cvlist_meta vlist_meta_invalid svlist_meta parse_string_null madd_linterp madd_lincom vlist add_bit_invalid add_lincom_invalid madd_bit_invalid madd_bit add_multiply_invalid add_const madd_multiply_invalid madd add_spec_invalid flist_type_meta_invalid add_spec flist_type_meta flist_meta parse_meta_index entry_raw_scalar_code parse_bit_scalar entry_raw_scalar_type entry_lincom_scalar entry_phase_scalar entry_raw_scalar parse_lincom_scalar entry_bit_scalar parse_raw_scalar parse_phase_scalar include include_nonexistent include_creat include_invalid include_accmode include_index madd_spec_directive madd_spec_invalid madd_spec parse_quote_mismatch parse_eol parse_foffs_include put_string parse_protect_data put_const put_string_protect ref put_const_protect parse_protect_all ref_none parse_ref add_protect parse_protect_format parse_protect_bad ref_two put_protect include_rdonly parse_ref_nonexistent parse_protect_none parse_name_pedantic parse_name_dot parse_name_ext parse_duplicate_ignore gzip_get gzip_nframes gzip_put gzip_get_get bzip_get bzip_nframes bzip_put bzip_get_get global_name open_cb_abort open_cb_cont open_cb_ignore open_cb_rescan open_cb_invalid del_const_force del_const del_derived_force del_const_deref del_meta_force del_data del_meta del del_derived close_discard global_ref_set global_ref_empty include_ignore global_ref include_ref include_auto move move_index move_protect move_data_enc_ar bzip_move_from gzip_move_from move_data_foffs move_data_enc_ra move_data_endian move_data_nop alter_multiply alter_bit_bitnum alter_entry_recode alter_linterp_move alter_raw_spf alter_entry alter_bit_numbits alter_lincom_slope alter_raw_type alter_lincom_input alter_const alter_phase alter_lincom_offset alter_linterp foffs_get foffs_move foffs_alter endian_alter endian_move endian_get encode_alter encode_get encode_move protect_alter move_subdir unclude_del name_move unclude file name file_type unclude_move file_code parent protect_get global_ref_get alter_mspec alter_spec include_cb include_pc include_syntax fragment_index fragment_name fragment_name_oor entry_type alter_polynom_coeff get_polynom_noin get_polynom put_polynom_noin madd_polynom parse_polynom_scalar alter_polynom_ord parse_polynom spf_polynom entry_polynom_scalar put_polynom1 put_polynom2 parse_polynom_ncols1 parse_polynom_ncols2 alter_polynom_input add_polynom entry_polynom parse_lincom_non_ncols parse_lincom_non get_lincom_non xz_get xz_nframes lzma_get lzma_nframes add_sbit parse_sbit put_sbit get_sbit madd_sbit flush_spec index_domain madd_clincom index madd_const index_range add_clincom add_cpolynom get_clincom convert_float32_complex64 convert_int32_complex128 get_endian_complex128_big get_endian_complex128_arm get_endian_complex128_little convert_complex64_float64 parse_meta_index2 convert_uint16_complex128 put_endian_complex64_arm put_endian_complex64_big put_endian_complex64_little convert_uint16_complex64 convert_float64_complex128 repr_int8 convert_complex64_int64 convert_uint64_complex64 convert_complex64_complex128 get_const convert_uint8_complex128 parse_meta_implicit2 convert_float32_complex128 get_complex64 add_spec_meta convert_float64_complex64 convert_int16_complex128 alter_cpolynom madd_cpolynom convert_int32_complex64 alter_lincom_23 convert_complex64_uint64 repr_uint8 put_complex128 get_endian_complex64_big get_endian_complex64_arm get_endian_complex64_little alter_spec_meta repr_real_a repr_real_i repr_real_m repr_real_r repr_int16 convert_uint8_complex64 repr_int32 madd_string convert_complex128_float64 repr_uint16 repr_int64 put_endian_complex128_arm put_endian_complex128_big put_endian_complex128_little get_complex128 repr_uint32 convert_complex128_uint64 get_const_repr convert_complex128_int64 repr_float32 repr_uint64 convert_int16_complex64 repr_float64 put_complex64 convert_uint64_complex128 convert_int64_complex64 repr_a repr_i repr_m repr_r get_const_complex convert_int8_complex128 convert_uint32_complex128 parse_meta_implicit get_cpolynom put_repr convert_complex128_complex64 convert_int8_complex64 convert_uint32_complex64 convert_int64_complex128 move_meta add_scalar alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 alter_entry_scalar4 get_zero entry_scalar_repr header_complex version_5_strict parse_version_permissive version_7_strict version_0 version_1 version_2 version_3 version_4 version_5 version_6 version_7 version_6_strict eof eof_index eof_lincom eof_phase bof bof_lincom bof_phase put_linterp_nomono get_linterp_sort put_linterp_reverse alter_lincom_32 parse_recip parse_divide alter_recip dfes_recip add_crecip89 add_divide put_divide madd_recip add_crecip get_recip_const spf_divide add_divide_invalid version_8 alter_crecip89 put_recip spf_recip madd_crecip89 alter_divide get_recip alter_crecip madd_divide dfes_divide madd_crecip add_recip get_divide version_8_strict version_5_write version_0_write version_7_write version_2_write version_4_write version_6_write version_1_write version_8_write version_3_write put_carray_slice cvlist_array_meta del_carray get_carray_slice cvlist_array del_carray_deref nmeta_vectors_del get_carray parse_carray madd_carray add_carray put_carray get_carray_len parse_carray_long alter_carray_len alter_carray_type ascii_get_get parse_include_relabs parse_include_absrel parse_include_relrel parse_include_absolute add_raw_include alter_crecip_zero alter_recip_zero Added: branches/getdata-0.7/test/alter_crecip_zero.c =================================================================== --- branches/getdata-0.7/test/alter_crecip_zero.c (rev 0) +++ branches/getdata-0.7/test/alter_crecip_zero.c 2011-04-03 11:19:43 UTC (rev 565) @@ -0,0 +1,62 @@ +/* Test field modifying */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <inttypes.h> +#include <errno.h> +#include <stdio.h> + +int main(void) +{ + const char* filedir = __TEST__ "dirfile"; + const char* format = __TEST__ "dirfile/format"; + const char* data = __TEST__ "dirfile/data"; + const char* format_data = "data RAW INT32 8\nphase PHASE data 1\n" + "div RECIP data 230.\n"; + int32_t data_data[256]; + double c[8]; +#ifdef GD_NO_C99_API + double v[2] = {1093, 3290}; +#else + double complex v = 1093 + _Complex_I * 3290; +#endif + int fd, i, ret, error, n, r = 0; + DIRFILE *D; + + mkdir(filedir, 0777); + + for (fd = 0; fd < 256; ++fd) + data_data[fd] = (int32_t)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 * sizeof(int32_t)); + close(fd); + + D = gd_open(filedir, GD_RDWR | GD_VERBOSE); + ret = gd_alter_crecip(D, "div", "phase", 0); + error = gd_error(D); + n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); + + gd_close(D); + + for (i = 0; i < 8; ++i) + CHECKFi(i,c[i], 230. / (i + 41.)); + + unlink(data); + unlink(format); + rmdir(filedir); + + CHECKI(error,0); + CHECKI(n,8); + CHECKI(ret,0); + + return r; +} Added: branches/getdata-0.7/test/alter_recip_zero.c =================================================================== --- branches/getdata-0.7/test/alter_recip_zero.c (rev 0) +++ branches/getdata-0.7/test/alter_recip_zero.c 2011-04-03 11:19:43 UTC (rev 565) @@ -0,0 +1,57 @@ +/* Test field modifying */ +#include "test.h" + +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <fcntl.h> +#include <string.h> +#include <inttypes.h> +#include <errno.h> +#include <stdio.h> + +int main(void) +{ + const char* filedir = __TEST__ "dirfile"; + const char* format = __TEST__ "dirfile/format"; + const char* data = __TEST__ "dirfile/data"; + const char* format_data = "data RAW INT32 8\nphase PHASE data 1\n" + "div RECIP data 230.\n"; + int32_t data_data[256]; + double c[8]; + int fd, i, ret, error, n, r = 0; + DIRFILE *D; + + mkdir(filedir, 0777); + + for (fd = 0; fd < 256; ++fd) + data_data[fd] = (int32_t)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 * sizeof(int32_t)); + close(fd); + + D = gd_open(filedir, GD_RDWR | GD_VERBOSE); + ret = gd_alter_recip(D, "div", "phase", 0.); + error = gd_error(D); + n = gd_getdata(D, "div", 5, 0, 1, 0, GD_FLOAT64, c); + + gd_close(D); + + for (i = 0; i < 8; ++i) + CHECKFi(i,c[i], 230. / (i + 41.)); + + unlink(data); + unlink(format); + rmdir(filedir); + + CHECKI(error,0); + CHECKI(n,8); + CHECKI(ret,0); + + return r; +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-04-03 11:18:20
|
Revision: 564 http://getdata.svn.sourceforge.net/getdata/?rev=564&view=rev Author: ketiltrout Date: 2011-04-03 11:18:13 +0000 (Sun, 03 Apr 2011) Log Message: ----------- In _GD_Change, don't update the dividend if it's zero. Modified Paths: -------------- branches/getdata-0.7/ChangeLog branches/getdata-0.7/NEWS branches/getdata-0.7/src/mod.c branches/getdata-0.7/test/Makefile.am Modified: branches/getdata-0.7/ChangeLog =================================================================== --- branches/getdata-0.7/ChangeLog 2011-03-30 02:19:07 UTC (rev 563) +++ branches/getdata-0.7/ChangeLog 2011-04-03 11:18:13 UTC (rev 564) @@ -1,3 +1,8 @@ +2011-04-03 D. V. Wiebe <ge...@ke...> svn:564 + * test/alter_crecip_zero.c test/alter_recip_zero.c: Added. + * src/mod.c (_GD_Change): If [c]dividend is zero, don't change it, per + documentation. + 2011-03-30 D. V. Wiebe <ge...@ke...> svn:563 * src/encoding.c (_GD_MissingFramework): Properly compute the module path. Modified: branches/getdata-0.7/NEWS =================================================================== --- branches/getdata-0.7/NEWS 2011-03-30 02:19:07 UTC (rev 563) +++ branches/getdata-0.7/NEWS 2011-04-03 11:18:13 UTC (rev 564) @@ -2,6 +2,8 @@ Library Changes + * BUG FIX: Passing a zero dividend to alter_crecip() and alter_recip() now + results in the dividend not changing, per documentation. * BUG FIX: GetData wasn't properly computing the module directory, causing encodings using external modules to fail with GD_E_UNSUPPORTED. * BUG FIX: Metafield records are now properly stored in the format file for Modified: branches/getdata-0.7/src/mod.c =================================================================== --- branches/getdata-0.7/src/mod.c 2011-03-30 02:19:07 UTC (rev 563) +++ branches/getdata-0.7/src/mod.c 2011-04-03 11:18:13 UTC (rev 564) @@ -606,18 +606,19 @@ Q.comp_scal = 0; if (N->comp_scal) { - j = _GD_AlterScalar(D, !_gd_ccmpc(E->EN(recip,cdividend), - N->EN(recip,cdividend)), GD_COMPLEX128, &Q.EN(recip,cdividend), - &(N->EN(recip,cdividend)), Q.scalar, Q.scalar_ind, N->scalar[0], - N->scalar_ind[0], E->e->calculated); + j = _GD_AlterScalar(D, cabs(N->EN(recip,cdividend)) != 0 && + !_gd_ccmpc(E->EN(recip,cdividend), N->EN(recip,cdividend)), + GD_COMPLEX128, &Q.EN(recip,cdividend), &(N->EN(recip,cdividend)), + Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], + E->e->calculated); Q.EN(recip,dividend) = creal(Q.EN(recip,cdividend)); if (cimag(Q.EN(recip,cdividend)) != 0) Q.comp_scal = 1; } else { - j = _GD_AlterScalar(D, E->EN(recip,dividend) != N->EN(recip,dividend), - GD_FLOAT64, &Q.EN(recip,dividend), &(N->EN(recip,dividend)), - Q.scalar, Q.scalar_ind, N->scalar[0], N->scalar_ind[0], - E->e->calculated); + j = _GD_AlterScalar(D, N->EN(recip,dividend) != 0 && + E->EN(recip,dividend) != N->EN(recip,dividend), GD_FLOAT64, + &Q.EN(recip,dividend), &(N->EN(recip,dividend)), Q.scalar, + Q.scalar_ind, N->scalar[0], N->scalar_ind[0], E->e->calculated); _gd_r2c(Q.EN(recip,cdividend), Q.EN(recip,dividend)); } Modified: branches/getdata-0.7/test/Makefile.am =================================================================== --- branches/getdata-0.7/test/Makefile.am 2011-03-30 02:19:07 UTC (rev 563) +++ branches/getdata-0.7/test/Makefile.am 2011-04-03 11:18:13 UTC (rev 564) @@ -55,14 +55,14 @@ ALTER_TESTS=alter_bit_bitnum alter_bit_numbits alter_carray_len \ alter_carray_type alter_const alter_cpolynom alter_crecip \ - alter_crecip89 alter_divide alter_entry alter_entry_recode \ - alter_entry_scalar2a alter_entry_scalar2n alter_entry_scalar3 \ - alter_entry_scalar4 alter_lincom_23 alter_lincom_32 \ - alter_lincom_input alter_lincom_offset alter_lincom_slope \ - alter_linterp alter_linterp_move alter_mspec alter_multiply \ - alter_phase alter_polynom_coeff alter_polynom_input \ + alter_crecip89 alter_crecip_zero alter_divide alter_entry \ + alter_entry_recode alter_entry_scalar2a alter_entry_scalar2n \ + alter_entry_scalar3 alter_entry_scalar4 alter_lincom_23 \ + alter_lincom_32 alter_lincom_input alter_lincom_offset \ + alter_lincom_slope alter_linterp alter_linterp_move alter_mspec \ + alter_multiply alter_phase alter_polynom_coeff alter_polynom_input \ alter_polynom_ord alter_raw_spf alter_raw_type alter_recip \ - alter_spec alter_spec_meta + alter_recip_zero alter_spec alter_spec_meta ASCII_TESTS=ascii_get ascii_get_get ascii_nframes ascii_put This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-03-30 02:19:13
|
Revision: 563 http://getdata.svn.sourceforge.net/getdata/?rev=563&view=rev Author: ketiltrout Date: 2011-03-30 02:19:07 +0000 (Wed, 30 Mar 2011) Log Message: ----------- Fix computation of module location. Also fix install of man page symlinks. Modified Paths: -------------- branches/getdata-0.7/ChangeLog branches/getdata-0.7/NEWS branches/getdata-0.7/man/Makefile.am branches/getdata-0.7/src/encoding.c Modified: branches/getdata-0.7/ChangeLog =================================================================== --- branches/getdata-0.7/ChangeLog 2011-03-29 23:38:39 UTC (rev 562) +++ branches/getdata-0.7/ChangeLog 2011-03-30 02:19:07 UTC (rev 563) @@ -1,3 +1,6 @@ +2011-03-30 D. V. Wiebe <ge...@ke...> svn:563 + * src/encoding.c (_GD_MissingFramework): Properly compute the module path. + 2011-03-29 D. V. Wiebe <ge...@ke...> svn:562 * src/flush.c (_GD_FieldSpec): For Standards Version >= 8, use new-style metafield syntax. Modified: branches/getdata-0.7/NEWS =================================================================== --- branches/getdata-0.7/NEWS 2011-03-29 23:38:39 UTC (rev 562) +++ branches/getdata-0.7/NEWS 2011-03-30 02:19:07 UTC (rev 563) @@ -2,6 +2,8 @@ Library Changes + * BUG FIX: GetData wasn't properly computing the module directory, causing + encodings using external modules to fail with GD_E_UNSUPPORTED. * BUG FIX: Metafield records are now properly stored in the format file for Standards Version 8. * BUG FIX: gd_raw_filename() wasn't clearing the Dirfile error before Modified: branches/getdata-0.7/man/Makefile.am =================================================================== --- branches/getdata-0.7/man/Makefile.am 2011-03-29 23:38:39 UTC (rev 562) +++ branches/getdata-0.7/man/Makefile.am 2011-03-30 02:19:07 UTC (rev 563) @@ -95,6 +95,7 @@ install-data-hook: cd $(DESTDIR)$(mandir)/man3 && \ for m in $(MAN3ALIASES); do \ + rm -f `echo $$m | $(SED) -e 's/.*://'`; \ $(LN_S) `echo $$m | $(SED) -e 's/:/ /'`; \ done Modified: branches/getdata-0.7/src/encoding.c =================================================================== --- branches/getdata-0.7/src/encoding.c 2011-03-29 23:38:39 UTC (rev 562) +++ branches/getdata-0.7/src/encoding.c 2011-03-30 02:19:07 UTC (rev 563) @@ -210,9 +210,9 @@ lt_dlhandle lib; /* make the library name */ - sprintf(library, "%slibgetdata%s-%s", GETDATA_MODULEDIR, + sprintf(library, "%s/libgetdata%s-%s", GETDATA_MODULEDIR, _gd_ef[encoding].affix, PACKAGE_VERSION); - library[10] -= 'A' - 'a'; + library[sizeof(GETDATA_MODULEDIR) + 10] -= 'A' - 'a'; /* open */ if ((lib = lt_dlopenext(library)) == NULL) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-03-29 23:38:46
|
Revision: 562 http://getdata.svn.sourceforge.net/getdata/?rev=562&view=rev Author: ketiltrout Date: 2011-03-29 23:38:39 +0000 (Tue, 29 Mar 2011) Log Message: ----------- Several bugfixes reported by Matthew Truch. Modified Paths: -------------- branches/getdata-0.7/ChangeLog branches/getdata-0.7/NEWS branches/getdata-0.7/src/entry.c branches/getdata-0.7/src/flush.c Modified: branches/getdata-0.7/ChangeLog =================================================================== --- branches/getdata-0.7/ChangeLog 2011-03-26 02:00:28 UTC (rev 561) +++ branches/getdata-0.7/ChangeLog 2011-03-29 23:38:39 UTC (rev 562) @@ -1,3 +1,9 @@ +2011-03-29 D. V. Wiebe <ge...@ke...> svn:562 + * src/flush.c (_GD_FieldSpec): For Standards Version >= 8, use new-style + metafield syntax. + + * src/entry.c (gd_raw_filename): Clear dirfile error on entry. + 2011-03-24 D. V. Wiebe <ge...@ke...> svn:558 GetData-0.7.2 released. Modified: branches/getdata-0.7/NEWS =================================================================== --- branches/getdata-0.7/NEWS 2011-03-26 02:00:28 UTC (rev 561) +++ branches/getdata-0.7/NEWS 2011-03-29 23:38:39 UTC (rev 562) @@ -1,7 +1,18 @@ -New in version 0.7.2rc3: +New in version 0.7.3: Library Changes + * BUG FIX: Metafield records are now properly stored in the format file for + Standards Version 8. + * BUG FIX: gd_raw_filename() wasn't clearing the Dirfile error before + operation, resulting in it failing erroneously in certain situations. + +|==============================================================================| + +New in version 0.7.2: + + Library Changes + * If built with modules, the plugin shared objects will now be installed in a separate directory (by default "${libdir}/getdata", but see the --with-module-dir option in ./configure). Modified: branches/getdata-0.7/src/entry.c =================================================================== --- branches/getdata-0.7/src/entry.c 2011-03-26 02:00:28 UTC (rev 561) +++ branches/getdata-0.7/src/entry.c 2011-03-29 23:38:39 UTC (rev 562) @@ -269,6 +269,8 @@ dtrace("%p, \"%s\"", D, field_code_in); + _GD_ClearError(D); + if (D->flags & GD_INVALID) {/* don't crash */ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL); dreturn("%p", NULL); Modified: branches/getdata-0.7/src/flush.c =================================================================== --- branches/getdata-0.7/src/flush.c 2011-03-26 02:00:28 UTC (rev 561) +++ branches/getdata-0.7/src/flush.c 2011-03-29 23:38:39 UTC (rev 562) @@ -282,7 +282,8 @@ ptr = E->field; - if (meta) { + /* From Standards Version 8 and on, just use Barth-style */ + if (meta && D->standards < 8) { fputs("META ", stream); for (; *ptr != '/'; ++ptr) fputc(*ptr, stream); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ket...@us...> - 2011-03-26 02:00:35
|
Revision: 561 http://getdata.svn.sourceforge.net/getdata/?rev=561&view=rev Author: ketiltrout Date: 2011-03-26 02:00:28 +0000 (Sat, 26 Mar 2011) Log Message: ----------- Zero-terminate long options list. Patch from Matthew Truch. Modified Paths: -------------- trunk/getdata/ChangeLog trunk/getdata/util/dirfile2ascii.c Modified: trunk/getdata/ChangeLog =================================================================== --- trunk/getdata/ChangeLog 2011-03-26 01:45:47 UTC (rev 560) +++ trunk/getdata/ChangeLog 2011-03-26 02:00:28 UTC (rev 561) @@ -1,3 +1,7 @@ +2011-03-25 D. V. Wiebe <ge...@ke...> svn:561 + * util/checkdirfile.c: Zero-terminate option list. Patch from Matthew + Truch. + 2011-03-22 Peter Kümmel <syn...@gm...> svn:538 * merge from 0.7 branch strtoll/strtoull replacement with gd_* functions Modified: trunk/getdata/util/dirfile2ascii.c =================================================================== --- trunk/getdata/util/dirfile2ascii.c 2011-03-26 01:45:47 UTC (rev 560) +++ trunk/getdata/util/dirfile2ascii.c 2011-03-26 02:00:28 UTC (rev 561) @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Matthew Truch +/* Copyright (C) 2010, 2011 Matthew Truch * Copyright (C) 2010 D. V. Wiebe * *************************************************************************** @@ -186,7 +186,8 @@ { "quiet", 0, NULL, 'q' }, { "skip", 1, NULL, 's' }, { "verbose", 0, NULL, 'v' }, - { "version", 0, NULL, 2 } + { "version", 0, NULL, 2 }, + { 0, 0, 0, 0 } }; /* handy things to know about conversion specifiers */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |