Thread: [Getdata-commits] SF.net SVN: getdata:[671] trunk/getdata (Page 5)
Scientific Database Format
Brought to you by:
ketiltrout
|
From: <ket...@us...> - 2012-03-14 19:54:56
|
Revision: 671
http://getdata.svn.sourceforge.net/getdata/?rev=671&view=rev
Author: ketiltrout
Date: 2012-03-14 19:54:48 +0000 (Wed, 14 Mar 2012)
Log Message:
-----------
* Don't sync, just close in gd_{close,discard,uninclude}.
* Added gd_raw_close() + bindings.
* Fix initialisation of file->pos in SIE encoding.
* Write SIE /encoding.
* Fix perl build to fix dependency tracking.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/fgetdata.h
trunk/getdata/bindings/f77/getdata.f.in
trunk/getdata/bindings/f77/getdata.f90.in
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/perl/Build.PL.in
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/perl/t/big_test.t
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/configure.ac
trunk/getdata/doc/list.tests
trunk/getdata/src/close.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/sie.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/ChangeLog 2012-03-14 19:54:48 UTC (rev 671)
@@ -1,3 +1,28 @@
+2012-03-14 D. V. Wiebe <ge...@ke...> svn:671
+ * src/flush.c (_GD_FlushFragment): Write SIE encoding directives.
+
+ * src/sie.c (_GD_SampIndOpen): Initialise file->pos to 0 to avoid issues
+ with _GD_GetFilePos.
+ * src/sie.c (_GD_SampIndSeek): Don't short circuit if no record is loaded.
+
+ * src/flush.c (_GD_Flush _GD_SyncOrClose): Make syncing optional with a new
+ parameter (syn).
+ * src/flush.c (gd_raw_close): Added.
+ * src/clsoe.c (_GD_ShutdownDirfile) src/include.c (gd_uninclude): Don't
+ sync, just close raw files.
+
+ * bindings/python/pydirfile.c (gdpy_dirfile_raw_close)
+ bindings/cxx/dirfile.cpp (Dirfile::RawClose) bindings/perl/simple_funcs.xsin
+ (raw_close) bindings/f77/fgetdata.c (GDRCLO) bindings/f77/getdata.f90.in
+ (fgd_raw_close): Added.
+ * bindings/idl/getdata.c (gdidl_flush): Add /NOSYNC.
+ * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+ bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+ bindings/f77/test/big_test95.f90: Added test 233.
+
+ * bindings/perl/Build.PL.in: subclass Module::Build to properly handle
+ simple_funcs.xs dependency tracking.
+
2012-03-06 D. V. Wiebe <ge...@ke...> svn:667
* src/errors.c: Change prefix on verbose output to "libgetdata".
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2012-03-14 19:54:48 UTC (rev 671)
@@ -511,6 +511,11 @@
return gd_sync(D, field_code);
}
+int Dirfile::RawClose(const char* field_code) const
+{
+ return gd_raw_close(D, field_code);
+}
+
int Dirfile::UnHide(const char* field_code) const
{
return gd_unhide(D, field_code);
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-03-14 19:54:48 UTC (rev 671)
@@ -227,6 +227,8 @@
size_t PutString(const char *field_code, const char *data_in) const;
+ int RawClose(const char *field_code = NULL) const;
+
GetData::RawEntry *Reference(const char* field_code = NULL) const;
const char *ReferenceFilename();
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-14 19:54:48 UTC (rev 671)
@@ -1639,6 +1639,9 @@
CHECK_OK2(232, 3);
CHECK_STRING2(232, 4, str, "test3 test4");
+ // 233: gd_raw_close check
+ d->RawClose("data");
+ CHECK_OK(233);
@@ -1646,6 +1649,7 @@
+
// ===================================================================
d->Discard();
delete d;
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/f77/fgetdata.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -3765,6 +3765,24 @@
dreturnvoid();
}
+/* gd_raw_close wrapper */
+void F77_FUNC(gdrclo, GDRCLO) (const int* dirfile, const char* field_code,
+ const int* field_code_l)
+{
+ dtrace("%i, %p, %i", *dirfile, field_code, *field_code_l);
+
+ if (field_code_l == 0)
+ gd_sync(_GDF_GetDirfile(*dirfile), NULL);
+ else {
+ char *out = (char *)malloc(*field_code_l + 1);
+ gd_raw_close(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *field_code_l));
+ free(out);
+ }
+
+ dreturnvoid();
+}
+
void F77_FUNC(gdtoke, GDTOKE) (char *toke, int *toke_l, const int *dirfile,
const char *string, const int *string_l, const int *n)
{
Modified: trunk/getdata/bindings/f77/fgetdata.h
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.h 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/f77/fgetdata.h 2012-03-14 19:54:48 UTC (rev 671)
@@ -620,6 +620,9 @@
void F77_FUNC(gdsync, GDSYNC) (const int* dirfile, const char* field_code,
const int* field_code_l);
+void F77_FUNC(gdrclo, GDRCLO) (const int* dirfile, const char* field_code,
+ const int* field_code_l);
+
void F77_FUNC(gdinca, GDINCA) (const int* dirfile, const char* file,
const int* file_l, const int* fragment_index, const char* prefix,
const int* prefix_l, const char* suffix, const int* suffix_l,
Modified: trunk/getdata/bindings/f77/getdata.f.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f.in 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/f77/getdata.f.in 2012-03-14 19:54:48 UTC (rev 671)
@@ -328,6 +328,8 @@
EXTERNAL GDPTST
C Corresponding to gd_putdata(3)
EXTERNAL GDPUTD
+C Corresponding to gd_raw_close(3)
+ EXTERNAL GDRCLO
C Corresponding to gd_reference(3)
EXTERNAL GDREFE
C Correpsonding to gd_rename(3)
Modified: trunk/getdata/bindings/f77/getdata.f90.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f90.in 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/f77/getdata.f90.in 2012-03-14 19:54:48 UTC (rev 671)
@@ -2734,6 +2734,13 @@
call gdsync(dirfile, TRIM(field_code), LEN_TRIM(field_code))
end subroutine
+subroutine fgd_raw_close (dirfile, field_code)
+ integer, intent(in) :: dirfile
+ character (len=*), intent(in) :: field_code
+
+ call gdrclo(dirfile, TRIM(field_code), LEN_TRIM(field_code))
+end subroutine
+
subroutine fgd_fragment_affixes (prefix, pl, suffix, sl, dirfile, &
fragment_index)
character(len=*), intent(out) :: prefix, suffix
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/f77/test/big_test.f 2012-03-14 19:54:48 UTC (rev 671)
@@ -2070,6 +2070,9 @@
CALL CHKIN2(ne, 232, 5, l, slen)
CALL CHKST2(ne, 232, 6, str, 'test3 test4')
+C 233: GDRCLO check
+ CALL GDRCLO(d, 'data', 4)
+ CALL CHKEOK(ne, 233, d)
@@ -2078,6 +2081,7 @@
+
C ===============================================================
C Cleanup
CALL GDDSCD(d)
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2012-03-14 19:54:48 UTC (rev 671)
@@ -2504,6 +2504,10 @@
call check_int2(ne, 232, 5, l, slen)
call check_str2(ne, 232, 6, str, 'test3 test4')
+! 233: fgd_raw_close check
+ call fgd_raw_close(d, 'data')
+ call check_ok(ne, 233, d)
+
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/idl/getdata.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -3055,6 +3055,7 @@
{ "FIELD_CODE", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(field_code_x),
IDL_KW_OFFSETOF(field_code) },
{ "NOCLOSE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noclose) },
+ { "NOSYNC", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(noclose) },
{ NULL }
};
@@ -3065,8 +3066,12 @@
if (kw.field_code_x)
field_code = IDL_STRING_STR(&kw.field_code);
- if (kw.noclose)
+ if (kw.noclose && kw.nosync)
+ idl_kw_abort("nothing to do");
+ else if (kw.noclose)
gd_sync(D, field_code);
+ else if (kw.nosync)
+ gd_raw_close(D, field_code);
else
gd_flush(D, field_code);
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2012-03-14 19:54:48 UTC (rev 671)
@@ -1341,6 +1341,10 @@
nume += check_ok2(232, 3 ,d)
nume += check_simple2(232, 4, str, "test3 test4")
+; 233: gd_raw_close check
+gd_flush, d, field_code='data', /nosync
+nume += check_ok(233, d)
+
Modified: trunk/getdata/bindings/perl/Build.PL.in
===================================================================
--- trunk/getdata/bindings/perl/Build.PL.in 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/perl/Build.PL.in 2012-03-14 19:54:48 UTC (rev 671)
@@ -1,7 +1,24 @@
# @configure_input@
use Module::Build;
-my $build = Module::Build->new(
+
+# divert up_to_date to allow consideration of simple_funcs.xs... is there an
+# easier way to do this?
+my $class = Module::Build->subclass(
+ class => "GetData::Build",
+ code => <<'SUBCLASS' );
+
+sub up_to_date {
+ my ($self, $source, $derived) = @_;
+
+ if ($source eq "lib/GetData.xs") {
+ return 0 if (not $self->up_to_date("lib/simple_funcs.xs", $derived));
+ }
+ return $self->SUPER::up_to_date($source, $derived);
+}
+SUBCLASS
+
+my $build = $class->new(
dist_abstract => "Perl bindings to the GetData library",
dist_author => 'The GetData Project <@PACKAGE_BUGREPORT@>',
dist_version_from => "GetData.pm",
Modified: trunk/getdata/bindings/perl/simple_funcs.xsin
===================================================================
--- trunk/getdata/bindings/perl/simple_funcs.xsin 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/perl/simple_funcs.xsin 2012-03-14 19:54:48 UTC (rev 671)
@@ -152,3 +152,4 @@
int madd_mplex(DIRFILE *dirfile, const char *parent, const char *field_code,
const char *in_field, const char *count_field, gd_count_t count_val,
gd_count_t count_max)
+int raw_close(DIRFILE *dirfile, const char *field_code)
Modified: trunk/getdata/bindings/perl/t/big_test.t
===================================================================
--- trunk/getdata/bindings/perl/t/big_test.t 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/perl/t/big_test.t 2012-03-14 19:54:48 UTC (rev 671)
@@ -22,7 +22,7 @@
use GetData;
use Math::Complex;
use strict;
-use Test::More tests => 1265;
+use Test::More tests => 1266;
my $ne = 0;
my ($s, @a, %h);
@@ -1661,6 +1661,9 @@
CheckOK(232);
CheckSArray(232, \@a, "test1 test2", "test3 test4", "test5");
+# 233: gd_raw_close check
+$s = $_->raw_close('data');
+CheckOK(233);
@@ -1668,5 +1671,7 @@
+
+
$d = $_ = undef;
system "rm -rf dirfile";
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/python/pydirfile.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -909,6 +909,30 @@
return Py_None;
}
+static PyObject* gdpy_dirfile_raw_close(struct gdpy_dirfile_t* self,
+ PyObject* args, PyObject* keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ char* keywords[] = { "field_code", NULL };
+ const char* field_code = NULL;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "|s:pygetdata.dirfile.raw_close",
+ keywords, &field_code))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ gd_raw_close(self->D, field_code);
+
+ PYGD_CHECK_ERROR(self->D, NULL);
+
+ Py_INCREF(Py_None);
+ dreturn("%p", Py_None);
+ return Py_None;
+}
+
static PyObject* gdpy_dirfile_include(struct gdpy_dirfile_t* self,
PyObject* args, PyObject* keys)
{
@@ -2532,10 +2556,8 @@
},
{"flush", (PyCFunction)gdpy_dirfile_flush, METH_VARARGS | METH_KEYWORDS,
"flush([field_code])\n\n"
- "Flush pending writes to the specified field to disk. This does\n"
- "not flush pending metadata changes. For that, use metaflush.\n"
- "However, if field_code is omitted, all data *and* metadata will be\n"
- "written to disk. See gd_flush(3)."
+ "Equivalent to sync([field_code]) && raw_close([field_code]).\n"
+ "See gd_flush(3)."
},
{"bof", (PyCFunction)gdpy_dirfile_getbof, METH_VARARGS | METH_KEYWORDS,
"bof(field_code)\n\n"
@@ -2954,9 +2976,19 @@
},
{"sync", (PyCFunction)gdpy_dirfile_sync, METH_VARARGS | METH_KEYWORDS,
"sync([field_code])\n\n"
- "This is similar to using Flush, but without closing the affected\n"
- "files. See gd_sync(3)."
+ "Flush pending writes to the specified field to disk. This does\n"
+ "not flush pending metadata changes. For that, use metaflush.\n"
+ "However, if field_code is omitted, all data *and* metadata will be\n"
+ "written to disk. See gd_sync(3)."
},
+ {"raw_close", (PyCFunction)gdpy_dirfile_raw_close,
+ METH_VARARGS | METH_KEYWORDS,
+ "raw_close([field_code])\n\n"
+ "Close any open raw data files associated with field_code, freeing\n"
+ /* ------- handy ruler ---------------------------------------------| */
+ "resources which may be used for other purposes. If field_code is\n"
+ "omitted, all open raw data files are closed. See gd_raw_close(3)."
+ },
{"naliases", (PyCFunction)gdpy_dirfile_naliases, METH_VARARGS | METH_KEYWORDS,
"naliases(field_code)\n\n"
"This function returns the number of aliases defined for the specified\n"
@@ -3005,7 +3037,6 @@
},
{"tokenise", (PyCFunction)gdpy_dirfile_tokenise, METH_VARARGS | METH_KEYWORDS,
"tokenise([string])\n\n"
- /* ------- handy ruler ---------------------------------------------| */
"If 'string' is given, runs the GetData tokeniser on 'string' and\n"
"returns the first token. If 'string' is not given, returns\n"
"subsequent tokens (one per call) of the last string that was\n"
Modified: trunk/getdata/bindings/python/test/big_test.py
===================================================================
--- trunk/getdata/bindings/python/test/big_test.py 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/bindings/python/test/big_test.py 2012-03-14 19:54:48 UTC (rev 671)
@@ -1915,6 +1915,13 @@
except:
CheckOK2(232, 3)
CheckSimple2(232, 4, str, "test3 test4")
+
+# 233: gd_raw_close check
+try:
+ d.raw_close('data')
+except:
+ CheckOK(233)
+
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/configure.ac 2012-03-14 19:54:48 UTC (rev 671)
@@ -959,8 +959,8 @@
AC_CONFIG_FILES([man/gd_alter_endianness.3])
AC_CONFIG_FILES([man/gd_alter_frameoffset.3])
AC_CONFIG_FILES([src/Makefile])
-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.
+dnl This doubling allows us to build getdata.h as a normal AC_CONFIG_FILE, but
+dnl use 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])
Modified: trunk/getdata/doc/list.tests
===================================================================
--- trunk/getdata/doc/list.tests 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/doc/list.tests 2012-03-14 19:54:48 UTC (rev 671)
@@ -244,3 +244,4 @@
230 F9CIpP gd_madd_mplex
231 F9CIpP gd_alter_mplex
232 F9CIpP gd_tokenise
+233 F9CIpP gd_raw_close
Modified: trunk/getdata/src/close.c
===================================================================
--- trunk/getdata/src/close.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/src/close.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -85,7 +85,7 @@
for(i = 0; i < D->n_entries; ++i)
if (D->entry[i]->field_type == GD_RAW_ENTRY)
- _GD_Flush(D, D->entry[i], 1);
+ _GD_Flush(D, D->entry[i], 0, 1);
if (D->error) {
dreturn("%i", 1);
Modified: trunk/getdata/src/flush.c
===================================================================
--- trunk/getdata/src/flush.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/src/flush.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -22,11 +22,11 @@
#define GD_MAX_PRETTY_FIELD_WIDTH 80
-void _GD_Flush(DIRFILE* D, gd_entry_t *E, int clo)
+void _GD_Flush(DIRFILE *D, gd_entry_t *E, int syn, int clo)
{
int i;
- dtrace("%p, %p, %i", D, E, clo);
+ dtrace("%p, %p, %i, %i", D, E, syn, clo);
if (++D->recurse_level >= GD_MAX_RECURSE_LEVEL) {
_GD_SetError(D, GD_E_RECURSE_LEVEL, GD_E_RECURSE_CODE, NULL, 0, E->field);
@@ -41,13 +41,15 @@
((_gd_ef[E->e->u.raw.file[0].subenc].flags & GD_EF_OOP) &&
(E->e->u.raw.file[1].idata >= 0)))
{
- if ((D->flags & GD_ACCMODE) == GD_RDWR &&
+ if (syn && (D->flags & GD_ACCMODE) == GD_RDWR &&
(E->e->u.raw.file[0].mode & GD_FILE_WRITE) &&
_gd_ef[E->e->u.raw.file[0].subenc].sync != NULL &&
(*_gd_ef[E->e->u.raw.file[0].subenc].sync)(E->e->u.raw.file))
+ {
_GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
NULL);
- else if (clo && _GD_FiniRawIO(D, E, E->fragment_index, GD_FINIRAW_KEEP))
+ } else if (clo && _GD_FiniRawIO(D, E, E->fragment_index,
+ GD_FINIRAW_KEEP))
{
_GD_SetError(D, GD_E_RAW_IO, 0, E->e->u.raw.file[0].name, errno,
NULL);
@@ -56,13 +58,13 @@
break;
case GD_LINCOM_ENTRY:
for (i = 2; i < E->EN(lincom,n_fields); ++i)
- _GD_Flush(D, E->e->entry[i], clo);
+ _GD_Flush(D, E->e->entry[i], syn, clo);
/* fallthrough */
case GD_MULTIPLY_ENTRY:
case GD_DIVIDE_ENTRY:
case GD_WINDOW_ENTRY:
case GD_MPLEX_ENTRY:
- _GD_Flush(D, E->e->entry[1], clo);
+ _GD_Flush(D, E->e->entry[1], syn, clo);
/* fallthrough */
case GD_LINTERP_ENTRY:
case GD_BIT_ENTRY:
@@ -70,7 +72,7 @@
case GD_POLYNOM_ENTRY:
case GD_SBIT_ENTRY:
case GD_RECIP_ENTRY:
- _GD_Flush(D, E->e->entry[0], clo);
+ _GD_Flush(D, E->e->entry[0], syn, clo);
case GD_CONST_ENTRY:
case GD_CARRAY_ENTRY:
case GD_STRING_ENTRY:
@@ -688,8 +690,14 @@
case GD_TEXT_ENCODED:
fputs("/ENCODING text\n", stream);
break;
+ case GD_SIE_ENCODED:
+ fputs("/ENCODING sie\n", stream);
+ break;
case 0:
break;
+ case GD_ZZIP_ENCODED:
+ case GD_ZZSLIM_ENCODED:
+ /* XXX do something here ... ? */
default:
fprintf(stream, "/ENCODING unknown # (%lx)\n", D->fragment[i].encoding);
break;
@@ -842,14 +850,14 @@
return (D->error == GD_E_OK) ? 0 : -1;
}
-static int _GD_SyncOrClose(DIRFILE* D, const char* field_code, int clo)
+static int _GD_SyncOrClose(DIRFILE* D, const char* field_code, int syn, int clo)
{
unsigned int i;
int repr;
char *simple_field_code;
gd_entry_t *E;
- dtrace("%p, \"%s\", %i", D, field_code, clo);
+ dtrace("%p, \"%s\", %i, %i", D, field_code, syn, clo);
_GD_ClearError(D);
@@ -860,14 +868,14 @@
if (!D->error)
for (i = 0; i < D->n_entries; ++i)
if (D->entry[i]->field_type == GD_RAW_ENTRY)
- _GD_Flush(D, D->entry[i], clo);
+ _GD_Flush(D, D->entry[i], syn, clo);
} else {
/* discard representation */
E = _GD_FindFieldAndRepr(D, field_code, &simple_field_code, &repr, NULL, 1,
1);
if (!D->error)
- _GD_Flush(D, E, clo);
+ _GD_Flush(D, E, syn, clo);
if (field_code != simple_field_code)
free(simple_field_code);
@@ -883,19 +891,31 @@
dtrace("%p, \"%s\"", D, field_code);
- ret = _GD_SyncOrClose(D, field_code, 0);
+ ret = _GD_SyncOrClose(D, field_code, 1, 0);
dreturn("%i", ret);
return ret;
}
+int gd_raw_close(DIRFILE *D, const char *field_code)
+{
+ int ret;
+
+ dtrace("%p, \"%s\"", D, field_code);
+
+ ret = _GD_SyncOrClose(D, field_code, 0, 1);
+
+ dreturn("%i", ret);
+ return ret;
+}
+
int gd_flush(DIRFILE *D, const char *field_code)
{
int ret;
dtrace("%p, \"%s\"", D, field_code);
- ret = _GD_SyncOrClose(D, field_code, 1);
+ ret = _GD_SyncOrClose(D, field_code, 1, 1);
dreturn("%i", ret);
return ret;
Modified: trunk/getdata/src/getdata.h.in
===================================================================
--- trunk/getdata/src/getdata.h.in 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/src/getdata.h.in 2012-03-14 19:54:48 UTC (rev 671)
@@ -943,6 +943,9 @@
extern DIRFILE *gd_open(const char *dirfilename,
unsigned long int flags) gd_nonnull ((1));
+extern int gd_raw_close(DIRFILE *dirfile,
+ const char *field_code) gd_nonnull ((1));
+
extern int gd_rename(DIRFILE *dirfile, const char *old_code,
const char *new_name, unsigned flags) gd_nonnull ((1,2,3));
Modified: trunk/getdata/src/include.c
===================================================================
--- trunk/getdata/src/include.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/src/include.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -463,7 +463,7 @@
if (D->entry[i]->field_type == GD_RAW_ENTRY &&
_GD_ContainsFragment(f, nf, D->entry[i]->fragment_index))
{
- _GD_Flush(D, D->entry[i], 1);
+ _GD_Flush(D, D->entry[i], 0, 1);
}
/* flush the fragment's metadata, if requested */
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/src/internal.h 2012-03-14 19:54:48 UTC (rev 671)
@@ -1003,7 +1003,7 @@
#define _GD_FileSwapBytes(D,i) ((D)->fragment[i].byte_sex & GD_BIG_ENDIAN)
#endif
int _GD_FiniRawIO(DIRFILE*, const gd_entry_t*, int, int);
-void _GD_Flush(DIRFILE *restrict, gd_entry_t *restrict, int);
+void _GD_Flush(DIRFILE *restrict, gd_entry_t *restrict, int, int);
void _GD_FlushMeta(DIRFILE* D, int fragment, int force);
void _GD_FreeE(DIRFILE *restrict, gd_entry_t *restrict, int);
off64_t _GD_GetEOF(DIRFILE *restrict, const gd_entry_t *restrict,
Modified: trunk/getdata/src/sie.c
===================================================================
--- trunk/getdata/src/sie.c 2012-03-12 22:35:14 UTC (rev 670)
+++ trunk/getdata/src/sie.c 2012-03-14 19:54:48 UTC (rev 671)
@@ -91,7 +91,7 @@
}
file->mode = mode;
- file->pos = -1;
+ file->pos = 0;
dreturn("%i", 0);
return 0;
}
@@ -140,7 +140,7 @@
dtrace("%p, %llx, 0x%X, 0x%X", file, (long long)sample, data_type, mode);
- if (file->pos == sample) {
+ if (file->pos == sample && f->p >= 0) {
dreturn("%lli", (long long)sample);
return sample;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-14 22:23:01
|
Revision: 674
http://getdata.svn.sourceforge.net/getdata/?rev=674&view=rev
Author: ketiltrout
Date: 2012-03-14 22:22:55 +0000 (Wed, 14 Mar 2012)
Log Message:
-----------
Handle failure of filedir canonicalisation better in gd_cbopen()
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/src/open.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-14 20:25:41 UTC (rev 673)
+++ trunk/getdata/ChangeLog 2012-03-14 22:22:55 UTC (rev 674)
@@ -1,3 +1,6 @@
+2012-03-14 D. V. Wiebe <ge...@ke...> svn:673
+ * src/open.c (gd_cbopen): Handle failure of _GD_CanonicalPath better.
+
2012-03-14 D. V. Wiebe <ge...@ke...> svn:671
* src/flush.c (_GD_FlushFragment): Write SIE encoding directives.
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2012-03-14 20:25:41 UTC (rev 673)
+++ trunk/getdata/src/open.c 2012-03-14 22:22:55 UTC (rev 674)
@@ -407,7 +407,7 @@
_GD_InitialiseFramework();
D = (DIRFILE *)malloc(sizeof(DIRFILE));
- if (dirfile == NULL || D == NULL) {
+ if (D == NULL) {
free(dirfile);
#ifndef GD_NO_DIR_OPEN
close(dirfd);
@@ -427,6 +427,15 @@
D->sehandler_extra = extra;
D->standards = GD_DIRFILE_STANDARDS_VERSION;
+ if (dirfile == NULL) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, filedir, errno, NULL);
+#ifndef GD_NO_DIR_OPEN
+ close(dirfd);
+#endif
+ dreturn("%p", D);
+ return D;
+ }
+
/* Add the INDEX entry */
D->n_entries = 1;
D->n[_GD_EntryIndex(GD_INDEX_ENTRY)] = 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-15 01:09:29
|
Revision: 675
http://getdata.svn.sourceforge.net/getdata/?rev=675&view=rev
Author: ketiltrout
Date: 2012-03-15 01:09:21 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
* gd_desync
* Use threadsafe readdir(3) while truncating.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/fgetdata.h
trunk/getdata/bindings/f77/getdata.f.in
trunk/getdata/bindings/f77/getdata.f90.in
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/make_parameters.c
trunk/getdata/bindings/perl/Makefile.am
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/perl/t/big_test.t
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/configure.ac
trunk/getdata/doc/list.tests
trunk/getdata/src/close.c
trunk/getdata/src/compat.c
trunk/getdata/src/flush.c
trunk/getdata/src/fragment.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/include.c
trunk/getdata/src/internal.h
trunk/getdata/src/open.c
trunk/getdata/test/Makefile.am
Added Paths:
-----------
trunk/getdata/test/desync.c
trunk/getdata/test/desync_flush.c
Property Changed:
----------------
trunk/getdata/test/
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/ChangeLog 2012-03-15 01:09:21 UTC (rev 675)
@@ -1,4 +1,44 @@
-2012-03-14 D. V. Wiebe <ge...@ke...> svn:673
+2012-03-15 D. V. Wiebe <ge...@ke...> svn:675
+ * src/internal.h: Add fragment->mtime, dirfile->open_flags. Deconst
+ fragment->sname.
+ * src/close.c (_GD_FreeD _GD_ShutdownDirfile): Add new parameter
+ (keep_dirfile) to prohibit deallocating the dirfile struct itself.
+ De-staticked _GD_ShutdownDirfile.
+ * src/include.c (_GD_Include): Compute the path relative to the parent of
+ fragment and store it in fragment->sname. Store mtime.
+ * src/close.c (_GD_FreeD): Free fragment->sname.
+ * src/flush.c (_GD_FlushFragment): Remove unnecessary strdup: we already
+ cache the basename. Update mtime.
+ * src/open.c (_GD_CreateDirfile): Return mtime.
+ * src/open.c (_GD_Open): Renamed from gd_cbopen; optionally take an existing
+ dirfd and DIRFILE pointer. Fix the dirfd/dirfile race condition by
+ canonicalising dirfile first.
+ * src/fragment.c (gd_desync) src/open.c (gd_cbopen): Added.
+ * src/getdata.h.in: Added GD_DESYNC_PATHCHECK GD_DESYNC_REOPEN.
+ * test/desync.c test/desync_flush.c: Added.
+
+ * src/internal.h (offsetof): Added.
+ * src/compat.c (gd_readdir): Added.
+ * src/open.c (_GD_TruncDir): Use a thread-safe readdir where possible.
+
+ * src/include.c (gd_include_affix): Don't call do stuff before validating
+ the dirfile.
+
+ * bindings/make_parameters.c: Add desync flags.
+ * bindings/python/pydirfile.c (gdpy_dirfile_desync) bindings/cxx/dirfile.cpp
+ (Dirfile::DeSync) bindings/perl/simple_funcs.xsin (desync)
+ bindings/f77/getdata.f90.in (fgd_desync) bindings/f77/fgetdata.c (GDDSYN)
+ bindings/idl/getdata.c (gdidl_desync): Added.
+ * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+ bindings/perl/t/big_test.t bindings/f77/test/big_test.f
+ bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Added test
+ 234.
+
+ * bindings/cxx/test/big_test.cpp: Functionise to reduce compilation work.
+
+ * bindings/perl/Makefile.am: Tweak yet some more.
+
+2012-03-14 D. V. Wiebe <ge...@ke...> svn:674
* src/open.c (gd_cbopen): Handle failure of _GD_CanonicalPath better.
2012-03-14 D. V. Wiebe <ge...@ke...> svn:671
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2012-03-15 01:09:21 UTC (rev 675)
@@ -525,3 +525,17 @@
{
return gd_tokenise(D, string);
}
+
+int Dirfile::DeSync(unsigned int flags)
+{
+ int desync = gd_desync(D, flags);
+ if (desync && flags & GD_DESYNC_REOPEN) {
+ free(error_string);
+ free(reference_name);
+
+ error_string = NULL;
+ reference_name = NULL;
+ }
+
+ return desync;
+}
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-03-15 01:09:21 UTC (rev 675)
@@ -116,6 +116,8 @@
int DeleteAlias(const char* field_code, int flags = 0) const;
+ int DeSync(unsigned int flags = 0);
+
int Discard();
GetData::Entry* Entry(const char *field_code) const;
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-15 01:09:21 UTC (rev 675)
@@ -48,67 +48,77 @@
using namespace std;
using namespace GetData;
-#define CHECK_ERRORb(d,t,g) \
- e = d->Error(); if (e != (g)) { ne++; cerr << "e[" << t << "] = " << e << endl; }
-#define CHECK_ERROR2b(d,t,n,g) \
- e = d->Error(); if (e != (g)) { \
- ne++; cerr << "e[" << t << ", " << n << "] = " << e << endl; }
-#define CHECK_ERROR(t,g) CHECK_ERRORb(d,t,g)
-#define CHECK_ERROR2(t,n,g) CHECK_ERROR2b(d,t,n,g)
+static int ne = 0;
+
+template <class T> static void CheckT(char c, int i, int t, int n, T v, T g,
+ int r)
+{
+ if (r) {
+ ne++;
+ cerr << c;
+ if (i != -1)
+ cerr << "(" << i << ")";
+ cerr << "[" << t;
+ if (n != -1)
+ cerr << ", " << n;
+ cerr << "] = " << v << " (expected " << g << ")" << endl;
+ }
+}
+
+static void CheckError(const Dirfile *d, int t, int n, int g)
+{
+ int e = d->Error();
+ CheckT<int>('e', -1, t, n, e, g, e != g);
+}
+
+static void CheckInt(int i, int t, int n, int v, int g)
+{
+ CheckT<int>('n', i, t, n, v, g, v != g);
+}
+
+template <class T> static void CheckFloat(char c, int i, int t, int n, T v, T g)
+{
+ CheckT<T>(c, i, t, n, v, g, (abs((v) - (g)) > 1e-10));
+}
+#define CHECK_ERROR(t,g) CheckError(d,t,-1,g)
+#define CHECK_ERROR2(t,n,g) CheckError(d,t,n,g)
#define CHECK_OK(t) CHECK_ERROR(t,GD_E_OK)
#define CHECK_OK2(t,n) CHECK_ERROR2(t,n,GD_E_OK)
-#define CHECK_NONNULL(t,v) \
- if ((v) == NULL) { ne++; cerr << "p[" << t << "] = " << (v) << endl; }
+#define CHECK_NONNULL(t,v) CheckT<const void*>('p', -1, t, -1, v, NULL, !(v))
-#define CHECK_NULL(t,v) \
- if ((v) != NULL) { ne++; cerr << "p[" << t << "] = " << (v) << endl; }
+#define CHECK_NULL(t,v) CheckT<const void*>('p', -1, t, -1, v, NULL, v)
+#define CHECK_NULL2(t,n,v) CheckT<const void*>('p', -1, t, n, v, NULL, v)
-#define CHECK_NULL2(t,n,v) \
- if ((v) != NULL) { \
- ne++; cerr << "n[" << t << ", " << n << "] = " << (v) << endl; }
+#define CHECK_INT(t,v,g) CheckInt(-1, t, -1, v, g)
+#define CHECK_INT2(t,n,v,g) CheckInt(-1, t, n, v, g)
-#define CHECK_INT(t,v,g) \
- if ((v) != (g)) { ne++; cerr << "n[" << t << "] = " << (v) << endl; }
-#define CHECK_INT2(t,n,v,g) \
- if ((v) != (g)) { \
- ne++; cerr << "n[" << t << ", " << n << "] = " << (v) << endl; }
#define CHECK_INT_ARRAY(t,m,v,g) \
- for (i = 0; i < m; ++i) if ((v) != (g)) { \
- ne++; cerr << "n(" << i << ")[" << t << "] = " << (int)v << endl; }
+ for (i = 0; i < m; ++i) CheckInt(i, t, -1, v, g)
-#define CHECK_DOUBLE(t,v,g) \
- if (fabs((v) - (g)) > 1e-10) { \
- ne++; cerr << "d[" << t << "] = " << (v) << endl; }
-#define CHECK_DOUBLE2(t,m,v,g) \
- if (fabs((v) - (g)) > 1e-10) { \
- ne++; cerr << "d[" << t << ", " << m << "] = " << (v) << endl; }
-#define CHECK_DOUBLE_ARRAY(t,m,n,v,g) \
- for (i = 0; i < n; ++i) if (fabs((v) - (g)) > 1e-10) { \
- ne++; cerr << "d(" << i << ")[" << t << ", " << m << "] = " << (v) << endl; }
+#define CHECK_DOUBLE(t,v,g) CheckFloat<double>('d', -1, t, -1, v, g)
+#define CHECK_DOUBLE2(t,n,v,g) CheckFloat<double>('d', -1, t, n, v, g)
+#define CHECK_DOUBLE_ARRAY(t,n,m,v,g) \
+ for (i = 0; i < m; ++i) CheckFloat<double>('d', i, t, n, v, g)
+
#define CHECK_STRING(t,v,g) \
- if (strcmp((v), (g))) { ne++; cerr << "s[" << t << "] = \"" << (v) << "\"" \
- << endl; }
-#define CHECK_STRING2(t,m,v,g) \
- if (strcmp((v), (g))) { \
- ne++; cerr << "s[" << t << ", " << m << "] = \"" << (v) << "\"" << endl; }
+ CheckT<const char*>('s', -1, t, -1, v, g, (strcmp((v), (g))))
+#define CHECK_STRING2(t,n,v,g) \
+ CheckT<const char*>('s', -1, t, n, v, g, (strcmp((v), (g))))
+
#define CHECK_STRING_ARRAY(t,m,v,g) \
- for (i = 0; i < m; ++i) if (strcmp((v), (g))) { \
- ne++; cerr << "s(" << i << ")[" << t << "] = \"" << (v) << "\"" << endl; }
+ for (i = 0; i < m; ++i) \
+CheckT<const char*>('s', i, t, -1, v, g, (strcmp((v), (g))))
#define CHECK_EOSTRING(t,v,g) \
- if (strcmp((v) + strlen(v) - strlen(g), (g))) { ne++; cerr << "s[" << t << "] = \"" << (v) << \
- "\", expected ...\"" << g << "\"" << endl; }
+ CheckT<const char*>('S', -1, t, -1, v, g, \
+ (strcmp((v) + strlen(v) - strlen(g), (g))))
-#define CHECK_COMPLEX2(t,m,v,g) \
- if (abs((v) - (g)) > 1e-10) { \
- ne++; cerr << "c[" << t << ", " << m << "] = " << (v).real() << ";" \
- << (v).imag() << endl; }
+#define CHECK_COMPLEX2(t,n,v,g) \
+ CheckFloat<complex<double> >('c', -1, t, n, v, g)
#define CHECK_COMPLEX_ARRAY(t,m,v,g) \
- for (i = 0; i < m; ++i) if (abs((v) - (g)) > 1e-10) { \
- ne++; cerr << "c(" << i << ")[" << t << "] = " << v.real() \
- << ";" << v.imag() << endl; }
+ for (i = 0; i < m; ++i) CheckFloat<complex<double> >('c', i, t, -1, v, g)
int main(void)
{
@@ -144,7 +154,7 @@
unsigned char c[8];
unsigned char data_data[80];
signed char sc;
- int m, n, i, e, ne = 0;
+ int m, n, i;
float fl;
double dp, p[6], q[6];
const double *qp;
@@ -1234,9 +1244,9 @@
// 156: Invalid Dirfile check
Dirfile *id = new Dirfile();
- CHECK_ERROR2b(id,156,1,GD_E_OK);
+ CheckError(id,156,1,GD_E_OK);
id->NFragments();
- CHECK_ERROR2b(id,156,2,GD_E_BAD_DIRFILE);
+ CheckError(id,156,2,GD_E_BAD_DIRFILE);
delete id;
// 157: Dirfile::Standards check
@@ -1643,6 +1653,10 @@
d->RawClose("data");
CHECK_OK(233);
+ // 234: gd_desync check
+ n = d->DeSync();
+ CHECK_OK(234);
+ CHECK_INT(234, n, 0);
@@ -1650,6 +1664,7 @@
+
// ===================================================================
d->Discard();
delete d;
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/f77/fgetdata.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -3808,3 +3808,13 @@
dreturn("%i", *toke_l);
}
+
+void F77_FUNC(gddsyn, GDDSYN) (int *desync, const int *dirfile,
+ const int *flags)
+{
+ dtrace("%p, %i, %i", desync, *dirfile, *flags);
+
+ *desync = gd_desync(_GDF_GetDirfile(*dirfile), *flags);
+
+ dreturn("%i", *desync);
+}
Modified: trunk/getdata/bindings/f77/fgetdata.h
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.h 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/f77/fgetdata.h 2012-03-15 01:09:21 UTC (rev 675)
@@ -671,6 +671,9 @@
const int *fragment_index);
void F77_FUNC(gdnocb, GDNOCB) (const int* dirfile);
+
+void F77_FUNC(gddsyn, GDDSYN) (int *desync, const int *dirfile,
+ const int *flags);
#ifdef __cplusplus
}
#endif
Modified: trunk/getdata/bindings/f77/getdata.f.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f.in 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/f77/getdata.f.in 2012-03-15 01:09:21 UTC (rev 675)
@@ -137,6 +137,8 @@
EXTERNAL GDDELE
C Corresponding to gd_discard(3)
EXTERNAL GDDSCD
+C Corresponding to gd_desync(3)
+ EXTERNAL GDDSYN
C Corresponding to gd_error_count(3)
EXTERNAL GDECNT
C Corresponding to gd_entry_type(3)
Modified: trunk/getdata/bindings/f77/getdata.f90.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f90.in 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/f77/getdata.f90.in 2012-03-15 01:09:21 UTC (rev 675)
@@ -2789,4 +2789,11 @@
call gdtoke(token, l, dirfile, TRIM(string), LEN_TRIM(string), n)
end subroutine
+function fgd_desync (dirfile, flags)
+ integer :: fgd_desync
+ integer, intent(in) :: dirfile, flags
+
+ call gddsyn(fgd_desync, dirfile, flags)
+end function
+
end module
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/f77/test/big_test.f 2012-03-15 01:09:21 UTC (rev 675)
@@ -2074,6 +2074,10 @@
CALL GDRCLO(d, 'data', 4)
CALL CHKEOK(ne, 233, d)
+C 234: GDDSYN check
+ CALL GDDSYN(n, d, 0)
+ CALL CHKEOK(ne, 234, d)
+ CALL CHKINT(ne, 234, n, 0)
@@ -2082,6 +2086,7 @@
+
C ===============================================================
C Cleanup
CALL GDDSCD(d)
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2012-03-15 01:09:21 UTC (rev 675)
@@ -2508,6 +2508,11 @@
call fgd_raw_close(d, 'data')
call check_ok(ne, 233, d)
+! 234: fgd_desync check
+ n = fgd_desync(d, 0)
+ call check_ok(ne, 234, d)
+ call check_int(ne, 234, n, 0)
+
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/idl/getdata.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -5590,9 +5590,49 @@
return r;
}
+/* @@DLM: F gdidl_desync GD_DESYNC 1 1 KEYWORDS */
+IDL_VPTR gdidl_desync(int argc, IDL_VPTR argv[], char *argk)
+{
+ dtraceidl();
+ int ret;
+ typedef struct {
+ IDL_KW_RESULT_FIRST_FIELD;
+ GDIDL_KW_RESULT_ERROR;
+ int pathcheck;
+ int reopen;
+ } KW_RESULT;
+ KW_RESULT kw;
+ GDIDL_KW_INIT_ERROR;
+ kw.pathcheck = kw.reopen = 0;
+ static IDL_KW_PAR kw_pars[] = {
+ GDIDL_KW_PAR_ERROR,
+ GDIDL_KW_PAR_ESTRING,
+ { "PATHCHECK", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(pathcheck) },
+ { "REOPEN", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(reopen) },
+ { NULL }
+ };
+
+ IDL_KWProcessByOffset(argc, argv, argk, kw_pars, NULL, 1, &kw);
+
+ DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
+
+ ret = gd_desync(D, (kw.pathcheck ? GD_DESYNC_PATHCHECK : 0) |
+ (kw.reopen ? GD_DESYNC_REOPEN : 0));
+
+ GDIDL_SET_ERROR(D);
+
+ IDL_KW_FREE;
+
+
+ IDL_VPTR r = IDL_GettmpInt(ret);
+ dreturn("%p", r);
+ return r;
+}
+
+
/**** Module initialisation ****/
/* These are defined in the automatically generated sublist.c */
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2012-03-15 01:09:21 UTC (rev 675)
@@ -1,3 +1,5 @@
+; vim: ft=idlang
+;
; Copyright (C) 2009-2012 D. V. Wiebe
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -1345,6 +1347,11 @@
gd_flush, d, field_code='data', /nosync
nume += check_ok(233, d)
+; 234: gd_desync check
+n = gd_desync(d)
+nume += check_ok(234, d)
+nume += check_simple(234, n, 0)
+
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/make_parameters.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -43,6 +43,7 @@
* 10: gd_seek whence values
* 11: gd_seek flags (not in IDL)
* 12: window operations
+ * 13: desynced flags (not in IDL)
* 99: miscellaneous constants
*/
#define CONSTANT(s,f,t) { "GD_" #s, #s, f, GD_ ## s, t }
@@ -214,6 +215,9 @@
CONSTANT(WINDOP_SET, "GDW_ST", 12),
CONSTANT(WINDOP_CLR, "GDW_CL", 12),
+ CONSTANT(DESYNC_PATHCHECK, "GDDS_P", 13),
+ CONSTANT(DESYNC_REOPEN, "GDDS_O", 13),
+
CONSTANT(ALL_FRAGMENTS, "GD_ALL", 99),
CONSTANT(COUNT_MAX, "GD_CMX", 99),
CONSTANT(DIRFILE_STANDARDS_VERSION, "GD_DSV", 99),
@@ -325,6 +329,13 @@
parameter(constant_list[j].lname, constant_list[j].fname,
constant_list[j].value, i);
+ printf("\\\n%c Desync flags\\\n", c);
+
+ for (j = 0; constant_list[j].lname != NULL; ++j)
+ if (constant_list[j].type == 13)
+ parameter(constant_list[j].lname, constant_list[j].fname,
+ constant_list[j].value, i);
+
printf("\\\n%c Miscellaneous parameters\\\n", c);
for (j = 0; constant_list[j].lname != NULL; ++j)
@@ -376,7 +387,7 @@
for (i = 0; constant_list[i].lname != NULL; ++i)
if ((constant_list[i].type != 1) && (constant_list[i].type != 5) &&
(constant_list[i].type != 7) && (constant_list[i].type != 8) &&
- (constant_list[i].type != 11))
+ (constant_list[i].type != 11) && (constant_list[i].type != 13))
{
printf("{ \"%s\", 0, (void*)IDL_TYP_%s }, ", constant_list[i].sname,
(constant_list[i].type == 2) ? "LONG" : "INT");
@@ -397,7 +408,7 @@
for (n = i = 0; constant_list[i].lname != NULL; ++i)
if ((constant_list[i].type != 1) && (constant_list[i].type != 5) &&
(constant_list[i].type != 7) && (constant_list[i].type != 8) &&
- (constant_list[i].type != 11))
+ (constant_list[i].type != 11) && (constant_list[i].type != 13))
{
printf("*(IDL_%s*)(data + IDL_StructTagInfoByIndex(gdidl_const_def, %i, "
"IDL_MSG_LONGJMP, NULL)) = %li;\n", (constant_list[i].type == 2) ?
Modified: trunk/getdata/bindings/perl/Makefile.am
===================================================================
--- trunk/getdata/bindings/perl/Makefile.am 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/perl/Makefile.am 2012-03-15 01:09:21 UTC (rev 675)
@@ -58,6 +58,7 @@
blib/arch/auto/GetData/GetData.bs: Build
$(PERL) $< build
+ touch $@
.PRECIOUS: Build
Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap
Modified: trunk/getdata/bindings/perl/simple_funcs.xsin
===================================================================
--- trunk/getdata/bindings/perl/simple_funcs.xsin 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/perl/simple_funcs.xsin 2012-03-15 01:09:21 UTC (rev 675)
@@ -153,3 +153,4 @@
const char *in_field, const char *count_field, gd_count_t count_val,
gd_count_t count_max)
int raw_close(DIRFILE *dirfile, const char *field_code)
+int desync(DIRFILE *dirfile, unsigned int flags)
Modified: trunk/getdata/bindings/perl/t/big_test.t
===================================================================
--- trunk/getdata/bindings/perl/t/big_test.t 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/perl/t/big_test.t 2012-03-15 01:09:21 UTC (rev 675)
@@ -22,7 +22,7 @@
use GetData;
use Math::Complex;
use strict;
-use Test::More tests => 1266;
+use Test::More tests => 1268;
my $ne = 0;
my ($s, @a, %h);
@@ -1665,6 +1665,10 @@
$s = $_->raw_close('data');
CheckOK(233);
+# 234: gd_desync
+$s = $_->desync(0);
+CheckOK(234);
+CheckNum(234, $s, 0);
@@ -1673,5 +1677,6 @@
+
$d = $_ = undef;
system "rm -rf dirfile";
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/python/pydirfile.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -2457,6 +2457,29 @@
return pyobj;
}
+static PyObject *gdpy_dirfile_desync(struct gdpy_dirfile_t *self,
+ void *args, void *keys)
+{
+ dtrace("%p, %p, %p", self, args, keys);
+
+ int ret;
+ char *keywords[] = { "flags", NULL };
+ unsigned int flags = 0;
+
+ if (!PyArg_ParseTupleAndKeywords(args, keys, "|I:pygetdata.dirfile.desync",
+ keywords, &flags))
+ {
+ dreturn("%p", NULL);
+ return NULL;
+ }
+
+ ret = gd_desync(self->D, flags);
+
+ PyObject* pyobj = PyInt_FromLong((long)ret);
+ dreturn("%p", pyobj);
+ return pyobj;
+}
+
static PyGetSetDef gdpy_dirfile_getset[] = {
{ "error", (getter)gdpy_dirfile_geterror, NULL,
"The numerical error code encountered by the last call to the GetData\n"
@@ -2985,7 +3008,6 @@
METH_VARARGS | METH_KEYWORDS,
"raw_close([field_code])\n\n"
"Close any open raw data files associated with field_code, freeing\n"
- /* ------- handy ruler ---------------------------------------------| */
"resources which may be used for other purposes. If field_code is\n"
"omitted, all open raw data files are closed. See gd_raw_close(3)."
},
@@ -3043,6 +3065,14 @@
"provided. Note: an error will result if the string being parsed\n"
"goes out of scope. See gd_tokenise(3)."
},
+ {"desync", (PyCFunction)gdpy_dirfile_desync, METH_VARARGS | METH_KEYWORDS,
+ "desync([flags])\n\n"
+ "Returns non-zero if the metadata on disk has changed since the\n"
+ "dirfile was opened, and optionally automatically reloads it. If\n"
+ "given, flags should be a bitwise or'd collection of the\n"
+ "pygetdata.DESYNC_... flags. See gd_desync(3)."
+ /* ------- handy ruler ---------------------------------------------| */
+ },
{ NULL, NULL, 0, NULL }
};
Modified: trunk/getdata/bindings/python/test/big_test.py
===================================================================
--- trunk/getdata/bindings/python/test/big_test.py 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/bindings/python/test/big_test.py 2012-03-15 01:09:21 UTC (rev 675)
@@ -1922,6 +1922,12 @@
except:
CheckOK(233)
+try:
+ n = d.desync()
+except:
+ CheckOK(234)
+CheckSimple(234, n, 0)
+
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/configure.ac 2012-03-15 01:09:21 UTC (rev 675)
@@ -545,9 +545,9 @@
echo "*** Looking for additional header files"
echo
AC_CHECK_HEADERS([asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \
- inttypes.h io.h libgen.h libkern/OSByteOrder.h stdint.h \
- sys/endian.h sys/file.h sys/param.h sys/stat.h sys/types.h \
- unistd.h])
+ inttypes.h io.h libgen.h libkern/OSByteOrder.h stddef.h \
+ stdint.h sys/endian.h sys/file.h sys/param.h sys/stat.h \
+ sys/types.h unistd.h])
if test "x$disable_c99" = "xno"; then
AC_CHECK_HEADERS([complex.h])
fi
@@ -693,13 +693,13 @@
echo
echo "*** Looking for additional library functions"
echo
-AC_CHECK_FUNCS([_chsize _chsize_s _commit fchmod _fdopen fdopendir fseeko \
- fseeko64 _fstat fstat64 _fstat64 fstatat fstatat64 fsync \
- ftello ftello64 ftruncate ftruncate64 getcwd _getcwd getdelim \
- gmtime_r lseek64 _lseeki64 lstat lstat64 _mkdir nan _open \
- openat _read readlink renameat _rmdir snprintf _snprintf \
- stat64 _stat64 _strtoi64 strtoll _strtoui64 strtoull _unlink \
- unlinkat _write])
+AC_CHECK_FUNCS([_chsize _chsize_s _commit fchmod _fdopen fdopendir fpathconf \
+ fseeko fseeko64 _fstat fstat64 _fstat64 fstatat fstatat64 \
+ fsync ftello ftello64 ftruncate ftruncate64 getcwd _getcwd \
+ getdelim gmtime_r lseek64 _lseeki64 lstat lstat64 _mkdir nan \
+ _open openat pathconf _read readdir_r readlink renameat _rmdir \
+ snprintf _snprintf stat64 _stat64 _strtoi64 strtoll _strtoui64 \
+ strtoull _unlink unlinkat _write])
if test "x$disable_c99" = "xno"; then
AC_CHECK_FUNCS([cabs])
fi
@@ -745,6 +745,13 @@
#endif
])
+AC_CHECK_DECLS([offsetof],,,
+ [
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
+])
+
AC_CHECK_DECLS([get_unaligned, put_unaligned],,,
[
#ifdef HAVE_ASM_UNALIGNED_H
Modified: trunk/getdata/doc/list.tests
===================================================================
--- trunk/getdata/doc/list.tests 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/doc/list.tests 2012-03-15 01:09:21 UTC (rev 675)
@@ -245,3 +245,4 @@
231 F9CIpP gd_alter_mplex
232 F9CIpP gd_tokenise
233 F9CIpP gd_raw_close
+234 F9CIpP gd_desync
Modified: trunk/getdata/src/close.c
===================================================================
--- trunk/getdata/src/close.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/src/close.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008-2011 D. V. Wiebe
+/* Copyright (C) 2008-2012 D. V. Wiebe
*
***************************************************************************
*
@@ -22,12 +22,12 @@
/* _GD_FreeD: free the DIRFILE and its subordinates
*/
-static void _GD_FreeD(DIRFILE* D)
+static void _GD_FreeD(DIRFILE *D, int keep_dirfile)
{
unsigned int i;
int j;
- dtrace("%p", D);
+ dtrace("%p, %i", D, keep_dirfile);
for (i = 0; i < D->n_entries; ++i)
_GD_FreeE(D, D->entry[i], 1);
@@ -39,6 +39,7 @@
free(D->fragment[j].bname);
free(D->fragment[j].cname);
free(D->fragment[j].ename);
+ free(D->fragment[j].sname);
free(D->fragment[j].ref_name);
}
@@ -61,16 +62,18 @@
for (i = 0; i < D->ndir; ++i)
free(D->dir[i].path);
free(D->dir);
- free(D);
+ if (!keep_dirfile)
+ free(D);
+
dreturnvoid();
}
-static int _GD_ShutdownDirfile(DIRFILE* D, int flush_meta)
+int _GD_ShutdownDirfile(DIRFILE* D, int flush_meta, int keep_dirfile)
{
unsigned int i;
- dtrace("%p, %i", D, flush_meta);
+ dtrace("%p, %i, %i", D, flush_meta, keep_dirfile);
if (D == NULL) {
dreturn("%i", 0);
@@ -98,7 +101,7 @@
close(D->dir[i].fd);
#endif
- _GD_FreeD(D);
+ _GD_FreeD(D, keep_dirfile);
dreturn("%i", 0);
return 0;
@@ -110,7 +113,7 @@
dtrace("%p", D);
- ret = _GD_ShutdownDirfile(D, 1);
+ ret = _GD_ShutdownDirfile(D, 1, 0);
dreturn("%i", ret);
return ret;
@@ -122,7 +125,7 @@
dtrace("%p", D);
- ret = _GD_ShutdownDirfile(D, 0);
+ ret = _GD_ShutdownDirfile(D, 0, 0);
dreturn("%i", ret);
return ret;
Modified: trunk/getdata/src/compat.c
===================================================================
--- trunk/getdata/src/compat.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/src/compat.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -280,3 +280,30 @@
return count;
}
#endif
+
+/* emulate readdir_r(3) with non-threadsafe readdir(3) */
+#ifndef HAVE_READDIR_R
+int gd_readdir(DIR *dirp, struct dirent *entry, struct dirent **result)
+{
+ struct dirent *local_entry;
+
+ dtrace("%p, %p, %p", dirp, entry, result);
+
+ errno = 0;
+ local_entry = readdir(dirp);
+ if (local_entry == NULL) {
+ *result = NULL;
+ if (errno) {
+ dreturn("%i", errno);
+ return errno;
+ }
+ dreturn("%i", 0);
+ return 0;
+ }
+
+ *result = entry;
+ memcpy(entry, local_entry, sizeof(struct dirent));
+ dreturn("%i", 0);
+ return 0;
+}
+#endif
Modified: trunk/getdata/src/flush.c
===================================================================
--- trunk/getdata/src/flush.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/src/flush.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -573,8 +573,8 @@
unsigned int u;
#ifdef HAVE_FCHMOD
mode_t mode;
- struct stat stat_buf;
#endif
+ struct stat stat_buf;
time_t t;
int dirfd = D->fragment[i].dirfd;
@@ -760,23 +760,21 @@
/* If no error was encountered, move the temporary file over the
* old format file, otherwise abort */
- ptr = _GD_Strdup(D, D->fragment[i].cname);
- if (ptr == NULL) {
- dreturnvoid();
- return;
- }
/* Only assume we've synced the file if the rename succeeds */
if (D->error != GD_E_OK)
gd_UnlinkAt(D, dirfd, temp_file, 0);
- else if (gd_RenameAt(D, dirfd, temp_file, dirfd, basename(ptr))) {
+ else if (gd_RenameAt(D, dirfd, temp_file, dirfd, D->fragment[i].bname)) {
_GD_SetError(D, GD_E_FLUSH, GD_E_FLUSH_RENAME, NULL, errno,
D->fragment[i].cname);
gd_UnlinkAt(D, dirfd, temp_file, 0);
} else
D->fragment[i].modified = 0;
- free(ptr);
+ /* update mtime, if successful */
+ if (!D->error && gd_StatAt(D, dirfd, D->fragment[i].bname, &stat_buf, 0) == 0)
+ D->fragment[i].mtime = stat_buf.st_mtime;
+
dreturnvoid();
}
Modified: trunk/getdata/src/fragment.c
===================================================================
--- trunk/getdata/src/fragment.c 2012-03-14 22:22:55 UTC (rev 674)
+++ trunk/getdata/src/fragment.c 2012-03-15 01:09:21 UTC (rev 675)
@@ -300,3 +300,99 @@
dreturn("%i", D->fragment[fragment_index].parent);
return D->fragment[fragment_index].parent;
}
+
+/* returns non-zero if the metadata has changed on disk since the dirfile was
+ * opened and, optionally, re-opens the dirfile.
+ */
+int gd_desync(DIRFILE *D, unsigned int flags)
+{
+ int changed = 0, i;
+ struct stat statbuf;
+
+ dtrace("%p, 0x%x", D, flags);
+
+ /* if we can't open directories, we're stuck with the full path method */
+#ifdef GD_NO_DIR_OPEN
+ flags |= GD_DESYNC_PATHCECK;
+#endif
+
+ _GD_ClearError(D);
+
+ if (D->flags & GD_INVALID) {
+ _GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
+ dreturn("%...
[truncated message content] |
|
From: <ket...@us...> - 2012-03-15 23:03:45
|
Revision: 676
http://getdata.svn.sourceforge.net/getdata/?rev=676&view=rev
Author: ketiltrout
Date: 2012-03-15 23:03:36 +0000 (Thu, 15 Mar 2012)
Log Message:
-----------
* VPATH build fixes.
* Fix GD_DESYNC_REOPEN.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/internal.h
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/fgetdata.h
trunk/getdata/bindings/f77/test/Makefile.am
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/package/README
trunk/getdata/bindings/idl/package/configure.ac
trunk/getdata/bindings/make_parameters.c
trunk/getdata/bindings/perl/Makefile.am
trunk/getdata/configure.ac
trunk/getdata/man/Makefile.am
trunk/getdata/man/gd_flush.3
trunk/getdata/man/gd_metaflush.3
trunk/getdata/src/fragment.c
trunk/getdata/src/internal.h
trunk/getdata/test/Makefile.am
trunk/getdata/test/bzip_get.c
trunk/getdata/test/bzip_move_from.c
trunk/getdata/test/bzip_nframes.c
trunk/getdata/test/endian_alter.c
trunk/getdata/test/endian_alter_sie.c
trunk/getdata/test/endian_get.c
trunk/getdata/test/endian_move.c
trunk/getdata/test/gzip_get.c
trunk/getdata/test/gzip_get_get.c
trunk/getdata/test/gzip_get_put.c
trunk/getdata/test/gzip_move_from.c
trunk/getdata/test/gzip_nframes.c
trunk/getdata/test/gzip_put.c
trunk/getdata/test/gzip_put_get.c
trunk/getdata/test/lzma_get.c
trunk/getdata/test/lzma_nframes.c
trunk/getdata/test/move_data_endian.c
trunk/getdata/test/slim_get.c
trunk/getdata/test/slim_nframes.c
trunk/getdata/test/xz_get.c
trunk/getdata/test/xz_nframes.c
trunk/getdata/test/zzip_nframes.c
trunk/getdata/test/zzslim_nframes.c
trunk/getdata/util/checkdirfile.c
trunk/getdata/util/dirfile2ascii.c
Added Paths:
-----------
trunk/getdata/bindings/perl/MANIFEST.in
trunk/getdata/bindings/perl/test/
trunk/getdata/man/gd_desync.3
trunk/getdata/test/desync_reopen.c
trunk/getdata/test/desync_reopen_inv.c
Removed Paths:
-------------
trunk/getdata/bindings/perl/MANIFEST
trunk/getdata/bindings/perl/t/
Property Changed:
----------------
trunk/getdata/src/
trunk/getdata/test/
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/ChangeLog 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,3 +1,19 @@
+2012-03-16 D. V. Wiebe <ge...@ke...> svn:676
+ * configure.ac bindings/idl/package/configure.ac src/include.h
+ bindings/make_parameters.c bindings/cxx/internal.h bindings/idl/getdata.c
+ test/test.h util/dirfile2ascii.c util/checkdirfile.c: Renamed config.h to
+ gd_config.h to get around lossage in the Perl CORE public headers.
+
+ * bindings/perl/test: Renamed from t.
+ * bindings/perl/MANIFEST.in: Renamed from MANIFEST.
+ * bindings/perl Makefile.am bindings/f77/test/Makefile.am: VPATH fixes.
+
+ * src/fragment.c (gd_desync): dup the dirfile fd before closing.
+ * test/desync_reopen.c test/desync_reopen_inv.c: Added.
+
+ * bindings/idl/package/configure.ac bindings/idl/package/README: Bump
+ GetData min version.
+
2012-03-15 D. V. Wiebe <ge...@ke...> svn:675
* src/internal.h: Add fragment->mtime, dirfile->open_flags. Deconst
fragment->sname.
Modified: trunk/getdata/bindings/cxx/internal.h
===================================================================
--- trunk/getdata/bindings/cxx/internal.h 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/cxx/internal.h 2012-03-15 23:03:36 UTC (rev 676)
@@ -19,7 +19,7 @@
// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifdef HAVE_CONFIG_H
-#include "../../src/config.h"
+#include "gd_config.h"
#endif
#undef GETDATA_LEGACY_API
#include "getdata/dirfile.h"
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-15 23:03:36 UTC (rev 676)
@@ -19,9 +19,9 @@
// 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "gd_config.h"
+#endif
#undef GETDATA_LEGACY_API
-#endif
#include "getdata/dirfile.h"
#include <sys/stat.h>
Modified: trunk/getdata/bindings/f77/fgetdata.h
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.h 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/f77/fgetdata.h 2012-03-15 23:03:36 UTC (rev 676)
@@ -21,12 +21,8 @@
#ifndef FGETDATA_H
#define FGETDATA_H
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
+#include "internal.h"
-#include "../../src/internal.h"
-
/* If F77_FUNC isn't defined, we have no knowledge of the F77 mangling scheme */
#ifndef F77_FUNC
# error The F77_FUNC macro must be defined to build the F77 bindings
Modified: trunk/getdata/bindings/f77/test/Makefile.am
===================================================================
--- trunk/getdata/bindings/f77/test/Makefile.am 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/f77/test/Makefile.am 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2010 D. V. Wiebe
+# Copyright (C) 2008-2010, 2012 D. V. Wiebe
#
##########################################################################
#
@@ -42,8 +42,8 @@
BUILT_SOUCES = test_getdata.f
-FFLAGS += -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME)
-FCFLAGS += -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
+FFLAGS += -I. -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME)
+FCFLAGS += -I. -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
F95LDADD=../libf95getdata.la $(F77LDADD)
F77LDADD=../libfgetdata.la
AM_LDFLAGS = -L..
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/idl/getdata.c 2012-03-15 23:03:36 UTC (rev 676)
@@ -29,7 +29,7 @@
#undef _SVID_SOURCE
#ifdef HAVE_CONFIG_H
-# include "config.h"
+# include "gd_config.h"
#endif
#ifdef GDIDL_EXTERNAL
Modified: trunk/getdata/bindings/idl/package/README
===================================================================
--- trunk/getdata/bindings/idl/package/README 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/idl/package/README 2012-03-15 23:03:36 UTC (rev 676)
@@ -79,7 +79,7 @@
PREREQUISITES
=============
-These bindings require GetData 0.7 or newer to build, as well as an IDL
+These bindings require GetData 0.8 or newer to build, as well as an IDL
interpreter verison 5.5 or later. No other external libraries are required,
save for the C Standard Library.
Modified: trunk/getdata/bindings/idl/package/configure.ac
===================================================================
--- trunk/getdata/bindings/idl/package/configure.ac 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/idl/package/configure.ac 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2008-2011 D. V. Wiebe
+dnl Copyright (C) 2008-2012 D. V. Wiebe
dnl
dnl llllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
dnl
@@ -39,7 +39,7 @@
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_SRCDIR([src/getdata.c])
-AC_CONFIG_HEADER([src/config.h])
+AC_CONFIG_HEADER([src/gd_config.h])
dnl Features
echo "*** Checking GetData configuration"
@@ -126,7 +126,7 @@
echo
echo "*** Looking for getdata"
echo
-PKG_CHECK_MODULES([GETDATA], [getdata >= 0.7.0])
+PKG_CHECK_MODULES([GETDATA], [getdata >= 0.8.0])
dnl headers
echo
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/make_parameters.c 2012-03-15 23:03:36 UTC (rev 676)
@@ -19,7 +19,7 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "gd_config.h"
#endif
#include <stdlib.h>
Deleted: trunk/getdata/bindings/perl/MANIFEST
===================================================================
--- trunk/getdata/bindings/perl/MANIFEST 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/perl/MANIFEST 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,2 +0,0 @@
-MANIFEST This list of files
-GetData.pm
Copied: trunk/getdata/bindings/perl/MANIFEST.in (from rev 675, trunk/getdata/bindings/perl/MANIFEST)
===================================================================
--- trunk/getdata/bindings/perl/MANIFEST.in (rev 0)
+++ trunk/getdata/bindings/perl/MANIFEST.in 2012-03-15 23:03:36 UTC (rev 676)
@@ -0,0 +1,2 @@
+MANIFEST This list of files
+GetData.pm
Modified: trunk/getdata/bindings/perl/Makefile.am
===================================================================
--- trunk/getdata/bindings/perl/Makefile.am 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/bindings/perl/Makefile.am 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,4 +1,4 @@
-# Copyright (C) 2011 D. V. Wiebe
+# Copyright (C) 2011, 2012 D. V. Wiebe
#
##########################################################################
#
@@ -21,48 +21,60 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST=funclist.pl GetData.xs simple_funcs.pl simple_funcs.xsin typemap \
- GetData.pm.in MANIFEST
+ GetData.pm.in MANIFEST.in test
if GETDATA_DEBUG
TEST_VERBOSE=verbose=1
endif
+PERL_TESTS=t/big_test.t t/callback.t
+
+t:
+ mkdir t
+
+t/%.t: test/%.t t
+ cat $< > $@
+
lib:
mkdir lib
-lib/GetData.xs: $(srcdir)/GetData.xs
+lib/GetData.xs: GetData.xs
$(MAKE) lib
- cat $< > $@
+ cat $(srcdir)/GetData.xs > $@
-lib/typemap: $(srcdir)/typemap
+lib/typemap: typemap
$(MAKE) lib
- cat $< > $@
+ cat $(srcdir)/typemap > $@
-lib/simple_funcs.xs: $(srcdir)/simple_funcs.xsin $(srcdir)/simple_funcs.pl
- $(PERL) $(srcdir)/simple_funcs.pl $< > $@
+lib/simple_funcs.xs: simple_funcs.xsin simple_funcs.pl
+ $(PERL) $(srcdir)/simple_funcs.pl $(srcdir)/simple_funcs.xsin > $@
+MANIFEST: MANIFEST.in
+ cat $(srcdir)/MANIFEST.in > $@
+
make_parameters.sed: ../make_parameters ../../src/getdata.h
../make_parameters P > $@
-../make_parameters: $(srcdir)/../make_parameters.c
+../make_parameters: ../make_parameters.c
cd .. && ${MAKE} make_parameters
-GetData.pm: $(srcdir)/GetData.pm.in make_parameters.sed $(srcdir)/funclist.pl \
- lib/GetData.xs lib/simple_funcs.xs
+GetData.pm: GetData.pm.in make_parameters.sed funclist.pl lib/GetData.xs \
+ lib/simple_funcs.xs
rm -f $@
- $(SED) -f make_parameters.sed $< | \
+ $(SED) -f make_parameters.sed $(srcdir)/GetData.pm.in | \
$(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@
chmod a-w $@
all-local: lib blib/arch/auto/GetData/GetData.bs
blib/arch/auto/GetData/GetData.bs: Build
- $(PERL) $< build
+ $(PERL) Build build
touch $@
.PRECIOUS: Build
-Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap
- perl $<
+Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \
+ MANIFEST
+ $(PERL) Build.PL
clean-local:
rm -rf lib
@@ -70,14 +82,14 @@
$(PERL) Build clean; \
fi
rm -f $(BUILT_SOURCES) make_parameters.sed MYMETA.yml MYMETA.json GetData.pm
- rm -rf Build _build
+ rm -rf Build _build MANIFEST t
if TEST_PERL
-check:
- $(MAKE) test
+check: $(PERL_TESTS)
+ ${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../src/.libs $(PERL) ./Build test ${TEST_VERBOSE}
-test testdb testcover:
+testdb testcover: $(PERL_TESTS)
${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../src/.libs $(PERL) ./Build $@ ${TEST_VERBOSE}
-.PHONY: test testdb testcover
+.PHONY: check testdb testcover
endif
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/configure.ac 2012-03-15 23:03:36 UTC (rev 676)
@@ -46,7 +46,7 @@
AC_SUBST(F95GETDATA_VERSION, [f95getdata_version])
AC_CONFIG_SRCDIR([src/getdata.c])
-AC_CONFIG_HEADER([src/config.h])
+AC_CONFIG_HEADER([src/gd_config.h])
dnl Features
BUINDINGS_BUILT=
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/man/Makefile.am 2012-03-15 23:03:36 UTC (rev 676)
@@ -56,6 +56,7 @@
dirfile.5 dirfile-encoding.5 dirfile-format.5 \
$(LFS_transitional_mans)
+# these are real_file:alias
MAN3ALIASES=gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
gd_add_bit.3:gd_add_const.3 gd_add_bit.3:gd_add_cpolynom.3 \
gd_add_bit.3:gd_add_crecip.3 gd_add_bit.3:gd_add_divide.3 \
@@ -83,7 +84,8 @@
gd_alter_spec.3:gd_malter_spec.3 gd_framenum_subset.3:gd_framenum.3 \
gd_get_carray_slice.3:gd_get_carray.3 gd_put_carray_slice.3:gd_put_carray.3 \
gd_delete.3:gd_delete_alias.3 gd_hide.3:gd_unhide.3 \
- gd_add_alias.3:gd_madd_alias.3 $(MAN3ALIASES64)
+ gd_add_alias.3:gd_madd_alias.3 gd_flush.3:gd_sync.3 \
+ gd_flush.3:gd_raw_close.3 $(MAN3ALIASES64)
#man conversion
HTMLMANS=$(addsuffix .html,$(nodist_man_MANS)) \
Added: trunk/getdata/man/gd_desync.3
===================================================================
--- trunk/getdata/man/gd_desync.3 (rev 0)
+++ trunk/getdata/man/gd_desync.3 2012-03-15 23:03:36 UTC (rev 676)
@@ -0,0 +1,129 @@
+.\" gd_desync.3. The gd_desync man page.
+.\"
+.\" Copyright (C) 2012 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_desync 3 "15 March 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_desync \(em check for a change of metadata on disk
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "int gd_desync(DIRFILE *" dirfile ", unsigned int " flags );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_desync ()
+function reports whether the metadata of the loaded
+.I dirfile
+has become desynchronised from the format specification fragments on disk, due
+to a third party modifying the Dirfile metadata on disk after GetData opened
+it. If
+.I dirfile
+has become desynchronised, this function can, optionally, reload the dirfile.
+
+The
+.I flags
+argument influences how the function works. It should be zero, or else one
+or more of the following flags, bitwise or'd together:
+.TP 8
+.B GD_DESYNC_PATHCHECK
+Ignore GetData's internal directory cache, and use the format specification
+fragments' full path when checking for modifications. This flag is of
+particular importance when the
+.I dirfilename
+passed to
+.BR gd_cbopen (3),
+or directory paths used in included fragments, contain symbolic links: with this
+flag, these symbolic links will be re-evaluated. Without it, the target of
+the symbolic links in effect when the dirfile was first opened will be
+considered instead.
+.TP
+.B GD_DESYNC_REOPEN
+If this flag is specified, and
+.BR gd_desync ()
+detects desynchronisation, the Dirfile will be re-opened in place using the
+exiting
+.I dirfile
+pointer. In this case, upon a positive result from this function, the caller
+must discard all cached information about the dirfile, even the assumption that
+.I dirfile
+has been succesfully opened.
+
+Re-opening the dirfile is equivalent to calling
+.BR gd_close (3),
+and then
+.BR gd_cbopen (3)
+with the same arguments used when originally creating
+.IR dirfile ,
+except that the
+.I dirfile
+pointer doesn't change its value. As a result, this function may invoke the
+registered parser callback function (see
+.BR gd_cbopen (3)
+and
+.BR gd_parser_callback (3)).
+.SH RETURN VALUE
+On successful deletion, zero is returned if the loaded dirfile has not
+desynchronised, or 1 if it has. On error, -1 is returned, regardless of
+desynchronisation and the dirfile error is set to a non-zero error value.
+Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+The library was unable to allocate memory.
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_RAW_IO
+An error occurred while trying to obtain the modification time of a fragment.
+.PP
+Additionally, if
+.B GD_DESYNC_REOPEN
+is used, this function may fail for any of the reasons listed in the
+.BR gd_close (3)
+and
+.BR gd_cbopen (3)
+manual pages.
+.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
+a call to
+.BR gd_error_string (3).
+.SH LIMITATIONS
+The current implementation uses file modification times as reported by
+.BR stat (2)
+to detect changes. These times have a granularity of, at best, one second. As
+a result, desynchronisation will not be detected in the case when a fragment is
+modified, then GetData reads it, then the fragment is modified again, all within
+one second. The caller may wish to perform its own monitoring using the
+pathnames returned by
+.BR gd_fragmentname (3).
+.PP
+On systems lacking a POSIX.1-2008 conformant
+.BR fstatat (2)
+(q.v.), this function may always operate as if
+.B GD_DESYNC_PATHCHECK
+had been specified, regarless of the actual
+.IR flags .
+.SH SEE ALSO
+.BR fstatat (2),
+.BR gd_cbopen (3),
+.BR gd_close (3),
+.BR gd_error (3),
+.BR gd_error_string (3),
+.BR gd_parser_callback (3)
Modified: trunk/getdata/man/gd_flush.3
===================================================================
--- trunk/getdata/man/gd_flush.3 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/man/gd_flush.3 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,6 +1,6 @@
.\" gd_flush.3. The gd_flush man page.
.\"
-.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 D. V. Wiebe
.\"
.\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
.\"
@@ -13,21 +13,27 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_flush 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_flush 3 "15 March 2012" "Version 0.8.0" "GETDATA"
.SH NAME
-gd_flush \(em write all pending dirfile changes to disk.
+gd_flush gd_raw_close gd_sync \(em write all pending dirfile changes to disk or
+close open raw fields
.SH SYNOPSIS
.B #include <getdata.h>
.HP
.nh
.ad l
+.HP
.BI "int gd_flush(DIRFILE *" dirfile ", const char *" field_code );
+.HP
+.BI "int gd_raw_close(DIRFILE *" dirfile ", const char *" field_code );
+.HP
+.BI "int gd_sync(DIRFILE *" dirfile ", const char *" field_code );
.hy
.ad n
.SH DESCRIPTION
The
-.BR gd_flush ()
-function flushes and closes all file handles associated with
+.BR gd_sync ()
+function flushes all pending writes to disk of raw data files associated with
.IR field_code ,
or its input(s), in the dirfile specified by
.IR dirfile .
@@ -38,21 +44,33 @@
.I field_code
is NULL, all fields in
.I dirfile
-will be flushed and closed. In this special case, modified metadata will
-also be flushed to disk as if
+will be flushed. In this special case, modified metadata will also be flushed
+to disk as if
.BR gd_metaflush (3)
-had been called.
+had been called. If the dirfile has been opened read-only, this function does
+nothing. Additionally, some encoding schemes may implement this as a NOP.
.PP
-Metadata is written to disk using the current Standards Version as stored in the
-.I dirfile
-object. See
-.BR gd_dirfile_standards (3)
-to change or report the current Standards Version. If the dirfile metadata
-conforms to no known Standards Version, a Standards non-compliant fragment will
-be written.
+The
+.BR gd_raw_close ()
+function closes any raw data files which GetData has opened associated with
+.IR field_code ,
+or its input(s). Again, if
+.I field_code
+is NULL, all open data files are closed.
+.PP
+Calling
+.BR gd_flush ()
+is essentially equivalent to calling first
+.BR gd_sync ()
+and then
+.BR gd_raw_close ()
+(ie. it does both tasks), although, if
+.I field_code
+is NULL, the order of operations if may be different than making the two explict
+calls.
.SH RETURN VALUE
-On success, zero is returned. On error, -1 is returned and the dirfile error is
-set to a non-zero error value. Possible error values are:
+On success, these functions return zero. On error, -1 is returned and the
+dirfile error is set to a non-zero error value. Possible error values are:
.TP 8
.B GD_E_ALLOC
The library was unable to allocate memory.
@@ -71,6 +89,8 @@
was not recognised.
.TP
.B GD_E_FLUSH
+(Not
+.BR gd_raw_close ().)
A temporary file could not be opened into which to write the modified metadata,
or renaming the temporary file over the original fragment failed. Only returned
when
Modified: trunk/getdata/man/gd_metaflush.3
===================================================================
--- trunk/getdata/man/gd_metaflush.3 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/man/gd_metaflush.3 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,6 +1,6 @@
.\" gd_metaflush.3. The gd_metaflush man page.
.\"
-.\" Copyright (C) 2008, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2010, 2011, 2012 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_metaflush 3 "19 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_metaflush 3 "15 March 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_metaflush \(em write modified dirfile metadata to disk
.SH SYNOPSIS
@@ -30,7 +30,7 @@
function flushes all pending metadata changes in the dirfile specified by
.I dirfile
to disk. This is accomplished by re-writing the format specification fragments
-containing modified metadata overwriting the existing files. Format file
+containing modified metadata, overwriting the existing files. Format file
fragments which are unchanged are not touched.
.PP
Metadata is written to disk using the current Standards Version as stored in the
@@ -42,7 +42,7 @@
be written.
.PP
This function flushes only metadata. To flush the field data as well, call
-.BR gd_flush (3)
+.BR gd_sync (3)
instead.
.SH RETURN VALUE
On success, zero is returned. On error, -1 is returned and the dirfile error is
@@ -77,5 +77,5 @@
.BR gd_dirfile_standards (3),
.BR gd_error (3),
.BR gd_error_string (3),
-.BR gd_flush (3),
-.BR gd_rewrite_fragment (3)
+.BR gd_rewrite_fragment (3),
+.BR gd_sync (3)
Property changes on: trunk/getdata/src
___________________________________________________________________
Modified: svn:ignore
- .deps
.libs
config.h
config.h.in
getdata.h
getdata.pc
stamp-h*
Makefile
Makefile.in
*.lo
*.la
*.swp
getdata.ah
+ .deps
.libs
gd_config.h
gd_config.h.in
getdata.h
getdata.pc
stamp-h*
Makefile
Makefile.in
*.lo
*.la
*.swp
getdata.ah
Modified: trunk/getdata/src/fragment.c
===================================================================
--- trunk/getdata/src/fragment.c 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/src/fragment.c 2012-03-15 23:03:36 UTC (rev 676)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2008,2010,2011 D. V. Wiebe
+/* Copyright (C) 2008, 2010, 2011, 2012 D. V. Wiebe
*
***************************************************************************
*
@@ -378,8 +378,16 @@
gd_parser_callback_t sehandler = D->sehandler;
void *extra = D->sehandler_extra;
unsigned long int flags = D->open_flags;
+ int dirfd = -1;
- int dirfd = (flags & GD_DESYNC_PATHCHECK) ? -1 : D->fragment[0].dirfd;
+ if (!(flags & GD_DESYNC_PATHCHECK)) {
+ dirfd = dup(D->fragment[0].dirfd);
+ if (dirfd == -1) {
+ _GD_SetError(D, GD_E_RAW_IO, 0, D->name, errno, NULL);
+ dreturn("%i", -1);
+ return -1;
+ }
+ }
D->name = NULL; /* so FreeD doesn't delete it */
if (_GD_ShutdownDirfile(D, 0, 1)) {
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-03-15 01:09:21 UTC (rev 675)
+++ trunk/getdata/src/internal.h 2012-03-15 23:03:36 UTC (rev 676)
@@ -23,7 +23,7 @@
#define GETDATA_INTERNAL_H
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "gd_config.h"
#endif
#include "getdata.h"
Property changes on: trunk/getdata/test
___________________________________________________________________
Modified: svn:ignore
- Makefile
Makefile.in
*.o
*.odirfile
*.swp
*.exe
.deps
.libs
add
add_affix
add_alias
add_alias_meta
add_bit
add_bit_bitnum
add_bit_bitsize
add_bit_invalid
add_bit_numbits
add_carray
add_clincom
add_code
add_const
add_cpolynom
add_crecip
add_crecip89
add_divide
add_divide_invalid
add_duplicate
add_format
add_invalid
add_lincom
add_lincom_invalid
add_lincom_nfields
add_linterp
add_linterp_invalid
add_meta
add_meta_alias
add_mplex
add_mplex_val
add_multiply
add_multiply_invalid
add_phase
add_phase_invalid
add_polynom
add_protect
add_raw
add_raw_include
add_raw_invalid
add_raw_spf
add_raw_type
add_rdonly
add_recip
add_resolv
add_sbit
add_scalar
add_scalar_carray
add_sort
add_spec
add_spec_directive
add_spec_invalid
add_spec_meta
add_spec_resolv
add_string
add_string_affix
add_type
add_window
add_window_op
alias_list
alias_list_alias
alias_list_missing
alias_num
alias_num_alias
alias_num_missing
alias_target
alias_target_alias
alias_target_missing
alter_bit_bitnum
alter_bit_numbits
alter_carray_len
alter_carray_type
alter_const
alter_cpolynom
alter_crecip
alter_crecip89
alter_crecip_zero
alter_divide
alter_entry
alter_entry_affix
alter_entry_hidden
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_mplex
alter_mspec
alter_mspec_affix
alter_multiply
alter_phase
alter_polynom_coeff
alter_polynom_input
alter_polynom_ord
alter_raw_spf
alter_raw_type
alter_recip
alter_recip_zero
alter_spec
alter_spec_affix
alter_spec_meta
alter_window
ascii_add
ascii_get
ascii_get_get
ascii_nframes
ascii_put
bof
bof_lincom
bof_phase
bzip_get
bzip_get_get
bzip_move_from
bzip_nframes
bzip_put
close
close_bad
close_discard
close_null
convert_complex128_complex64
convert_complex128_float64
convert_complex128_int64
convert_complex128_uint64
convert_complex64_complex128
convert_complex64_float64
convert_complex64_int64
convert_complex64_uint64
convert_float32_complex128
convert_float32_complex64
convert_float32_float64
convert_float32_int16
convert_float32_int32
convert_float32_int64
convert_float32_int8
convert_float32_uint16
convert_float32_uint32
convert_float32_uint64
convert_float32_uint8
convert_float64_complex128
convert_float64_complex64
convert_float64_float32
convert_float64_int16
convert_float64_int32
convert_float64_int64
convert_float64_int8
convert_float64_uint16
convert_float64_uint32
convert_float64_uint64
convert_float64_uint8
convert_int16_complex128
convert_int16_complex64
convert_int16_float32
convert_int16_float64
convert_int16_int32
convert_int16_int64
convert_int16_int8
convert_int16_uint16
convert_int16_uint32
convert_int16_uint64
convert_int16_uint8
convert_int32_complex128
convert_int32_complex64
convert_int32_float32
convert_int32_float64
convert_int32_int16
convert_int32_int64
convert_int32_int8
convert_int32_uint16
convert_int32_uint32
convert_int32_uint64
convert_int32_uint8
convert_int64_complex128
convert_int64_complex64
convert_int64_float32
convert_int64_float64
convert_int64_int16
convert_int64_int32
convert_int64_int8
convert_int64_uint16
convert_int64_uint32
convert_int64_uint64
convert_int64_uint8
convert_int8_complex128
convert_int8_complex64
convert_int8_float32
convert_int8_float64
convert_int8_int16
convert_int8_int32
convert_int8_int64
convert_int8_uint16
convert_int8_uint32
convert_int8_uint64
convert_int8_uint8
convert_uint16_complex128
convert_uint16_complex64
convert_uint16_float32
convert_uint16_float64
convert_uint16_int16
convert_uint16_int32
convert_uint16_int64
convert_uint16_int8
convert_uint16_uint32
convert_uint16_uint64
convert_uint16_uint8
convert_uint32_complex128
convert_uint32_complex64
convert_uint32_float32
convert_uint32_float64
convert_uint32_int16
convert_uint32_int32
convert_uint32_int64
convert_uint32_int8
convert_uint32_uint16
convert_uint32_uint64
convert_uint32_uint8
convert_uint64_complex128
convert_uint64_complex64
convert_uint64_float32
convert_uint64_float64
convert_uint64_int16
convert_uint64_int32
convert_uint64_int64
convert_uint64_int8
convert_uint64_uint16
convert_uint64_uint32
convert_uint64_uint8
convert_uint8_complex128
convert_uint8_complex64
convert_uint8_float32
convert_uint8_float64
convert_uint8_int16
convert_uint8_int32
convert_uint8_int64
convert_uint8_int8
convert_uint8_uint16
convert_uint8_uint32
convert_uint8_uint64
creat
creat_excl
creat_rdonly
cvlist
cvlist_array
cvlist_array_hidden
cvlist_array_meta
cvlist_array_meta_hidden
cvlist_hidden
cvlist_invalid
cvlist_meta
cvlist_meta_hidden
cvlist_meta_invalid
del
del_carray
del_carray_deref
del_const
del_const_deref
del_const_force
del_data
del_derived
del_derived_after
del_derived_force
del_meta
del_meta_force
desync
desync_flush
dfes_bit
dfes_divide
dfes_lincom
dfes_linterp
dfes_multiply
dfes_null
dfes_phase
dfes_raw
dfes_recip
dfes_zero
encode_alter
encode_get
encode_move
endian_alter
endian_alter_sie
endian_get
endian_move
entry_bad_code
entry_bit
entry_bit_scalar
entry_divide
entry_invalid
entry_lincom
entry_lincom_scalar
entry_linterp
entry_mplex
entry_mplex_scalar
entry_multiply
entry_phase
entry_phase_scalar
entry_polynom
entry_polynom_scalar
entry_raw
entry_raw_scalar
entry_raw_scalar_code
entry_raw_scalar_type
ent...
[truncated message content] |
|
From: <ket...@us...> - 2012-03-17 02:37:17
|
Revision: 678
http://getdata.svn.sourceforge.net/getdata/?rev=678&view=rev
Author: ketiltrout
Date: 2012-03-17 02:37:11 +0000 (Sat, 17 Mar 2012)
Log Message:
-----------
Added GD_E_EXISTS.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/make_parameters.c
trunk/getdata/man/gd_cbopen.3
trunk/getdata/src/errors.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/internal.h
trunk/getdata/src/legacy.c
trunk/getdata/src/open.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/ChangeLog 2012-03-17 02:37:11 UTC (rev 678)
@@ -1,3 +1,8 @@
+2012-03-16 D. V. Wiebe <ge...@ke...> svn:678
+ * src/errors.c src/getdata.h.in: Add GD_E_EXISTS
+ * src/open.c (_GD_CreateDirfile): Replace GD_E_CREAT:GD_E_CREAT_EXCL with
+ GD_E_EXISTS.
+
2012-03-16 D. V. Wiebe <ge...@ke...> svn:676
* configure.ac bindings/idl/package/configure.ac src/include.h
bindings/make_parameters.c bindings/cxx/internal.h bindings/idl/getdata.c
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/bindings/make_parameters.c 2012-03-17 02:37:11 UTC (rev 678)
@@ -63,7 +63,6 @@
CONSTANT(E_BAD_TYPE, "GD_EBT", 0),
CONSTANT(E_RAW_IO, "GD_ERW", 0),
CONSTANT(E_OPEN_FRAGMENT, "GD_EOF", 0),
- CONSTANT(E_OPEN_INCLUDE, "GD_EOI", 0), /* deprecated */
CONSTANT(E_INTERNAL_ERROR, "GD_EIE", 0),
CONSTANT(E_ALLOC, "GD_EAL", 0),
CONSTANT(E_RANGE, "GD_ERA", 0),
@@ -83,9 +82,8 @@
CONSTANT(E_PROTECTED, "GD_EPT", 0),
CONSTANT(E_DELETE, "GD_EDL", 0),
CONSTANT(E_ARGUMENT, "GD_EAR", 0),
- CONSTANT(E_BAD_ENDIANNESS, "GD_EEN", 0), /* deprecated */
CONSTANT(E_CALLBACK, "GD_ECB", 0),
- CONSTANT(E_BAD_PROTECTION, "GD_EBP", 0), /* deprecated */
+ CONSTANT(E_EXISTS, "GD_EEX", 0),
CONSTANT(E_UNCLEAN_DB, "GD_UCL", 0),
CONSTANT(E_DOMAIN, "GD_EDO", 0),
CONSTANT(E_BAD_REPR, "GD_ERP", 0),
@@ -94,6 +92,10 @@
CONSTANT(E_BOUNDS, "GD_EBO", 0),
CONSTANT(E_LINE_TOO_LONG, "GD_ETL", 0),
+ CONSTANT(E_OPEN_INCLUDE, "GD_EOI", 0), /* deprecated */
+ CONSTANT(E_BAD_ENDIANNESS, "GD_EEN", 0), /* deprecated */
+ CONSTANT(E_BAD_PROTECTION, "GD_EBP", 0), /* deprecated */
+
CONSTANT(RDONLY, "GD_RO", 1),
CONSTANT(RDWR, "GD_RW", 1),
CONSTANT(FORCE_ENDIAN, "GD_FE", 1),
Modified: trunk/getdata/man/gd_cbopen.3
===================================================================
--- trunk/getdata/man/gd_cbopen.3 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/man/gd_cbopen.3 2012-03-17 02:37:11 UTC (rev 678)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_cbopen 3 "1 January 2012" "Version 0.8.0" "GETDATA"
+.TH gd_cbopen 3 "17 March 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_cbopen, gd_open \(em open or create a dirfile
.SH SYNOPSIS
@@ -623,7 +623,10 @@
returned an unrecognised response.
.TP
.B GD_E_CREAT
-The library was unable to create the dirfile, or the dirfile exists and both
+The library was unable to create the dirfile.
+.TP
+.B GD_E_EXISTS
+The dirfile already exists and both
.BR GD_CREAT " and " GD_EXCL
were specified.
.TP
Modified: trunk/getdata/src/errors.c
===================================================================
--- trunk/getdata/src/errors.c 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/src/errors.c 2012-03-17 02:37:11 UTC (rev 678)
@@ -85,8 +85,6 @@
{ GD_E_CREAT, GD_E_CREAT_DIR, "Unable to create directory {2}: ", 1 },
{ GD_E_CREAT, GD_E_CREAT_OPEN, "Unable to open directory {2}: ", 1 },
{ GD_E_CREAT, GD_E_CREAT_FORMAT, "Unable to create format file {2}: ", 1 },
- { GD_E_CREAT, GD_E_CREAT_EXCL, "Unable to create dirfile {2}: already exists",
- 0 },
/* GD_E_BAD_CODE: 4 = field code */
{ GD_E_BAD_CODE, GD_E_CODE_MISSING, "Field not found: {4}", 0 },
{ GD_E_BAD_CODE, GD_E_CODE_INVALID, "Bad field name: {4}", 0 },
@@ -181,6 +179,8 @@
{ GD_E_ARGUMENT, 0, "Bad argument", 0 },
/* GD_E_CALLBACK: 3 = response */
{ GD_E_CALLBACK, 0, "Unrecognised response from callback function: {3}", 0 },
+ /* GD_E_ExISTS: (nothing) */
+ { GD_E_EXISTS, 0, "Dirfile exists", 0 },
/* GD_E_UNCLEAN_DB: 3 = fragment */
{ GD_E_UNCLEAN_DB, 0,
"Unexpected system error processing {3}; database unclean", 0 },
Modified: trunk/getdata/src/getdata.h.in
===================================================================
--- trunk/getdata/src/getdata.h.in 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/src/getdata.h.in 2012-03-17 02:37:11 UTC (rev 678)
@@ -144,7 +144,7 @@
#define GD_E_DELETE 26
#define GD_E_ARGUMENT 27
#define GD_E_CALLBACK 28
-/* unused 29 */
+#define GD_E_EXISTS 29
#define GD_E_UNCLEAN_DB 30
#define GD_E_DOMAIN 31
#define GD_E_BAD_REPR 32
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/src/internal.h 2012-03-17 02:37:11 UTC (rev 678)
@@ -618,9 +618,8 @@
#define GD_E_TRUNC_DIR 3
#define GD_E_CREAT_FORMAT 1
-#define GD_E_CREAT_EXCL 2
-#define GD_E_CREAT_DIR 3
-#define GD_E_CREAT_OPEN 4
+#define GD_E_CREAT_DIR 2
+#define GD_E_CREAT_OPEN 3
#define GD_E_CODE_MISSING 1
#define GD_E_CODE_INVALID 2
Modified: trunk/getdata/src/legacy.c
===================================================================
--- trunk/getdata/src/legacy.c 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/src/legacy.c 2012-03-17 02:37:11 UTC (rev 678)
@@ -72,7 +72,7 @@
NULL, /* GD_E_DELETE */
"Bad argument", /* GD_E_ARGUMENT */
NULL, /* GD_E_CALLBACK */
- NULL, /* unused */
+ NULL, /* GD_E_EXISTS */
NULL, /* GD_E_UNCLEAN_DB */
"Improper domain", /* GD_E_DOMAIN */
"Bad representation", /* GD_E_BAD_REPR */
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2012-03-15 23:05:42 UTC (rev 677)
+++ trunk/getdata/src/open.c 2012-03-17 02:37:11 UTC (rev 678)
@@ -260,7 +260,7 @@
/* It does exist, but we were asked to exclusively create it */
if (!format_error && (D->flags & GD_CREAT) && (D->flags & GD_EXCL)) {
- _GD_SetError(D, GD_E_CREAT, GD_E_CREAT_EXCL, dirfile, 0, NULL);
+ _GD_SetError(D, GD_E_EXISTS, 0, NULL, 0, NULL);
free(dirfile);
close(fd);
dreturn("%p", NULL);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-20 02:40:31
|
Revision: 680
http://getdata.svn.sourceforge.net/getdata/?rev=680&view=rev
Author: ketiltrout
Date: 2012-03-20 02:40:21 +0000 (Tue, 20 Mar 2012)
Log Message:
-----------
* gd_flags(), gd_verbose_prefix() + bindings
* avoid FPE in _GD_FlushFragment
* zero errno in _GD_Open
* add misisng IDL open flags
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/fgetdata.h
trunk/getdata/bindings/f77/getdata.f.in
trunk/getdata/bindings/f77/getdata.f90.in
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/make_parameters.c
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/perl/test/big_test.t
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/configure.ac
trunk/getdata/doc/list.tests
trunk/getdata/src/add.c
trunk/getdata/src/errors.c
trunk/getdata/src/flush.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/globals.c
trunk/getdata/src/internal.h
trunk/getdata/src/open.c
trunk/getdata/test/Makefile.am
trunk/getdata/test/test.h
Added Paths:
-----------
trunk/getdata/test/error_verbose.c
trunk/getdata/test/error_verbose_prefix.c
trunk/getdata/test/global_flags.c
Property Changed:
----------------
trunk/getdata/test/
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-17 02:40:29 UTC (rev 679)
+++ trunk/getdata/ChangeLog 2012-03-20 02:40:21 UTC (rev 680)
@@ -1,3 +1,32 @@
+2012-03-16 D. V. Wiebe <ge...@ke...> svn:680
+ * src/globals.c (gd_flags gd_verbose_prefix): Added.
+ * src/errors.c (_GD_SetError): Print verbose prefix, if present.
+
+ * make_parameters.c: Promote GD_VERBOSE and GD_PRETTY_PRINT.
+ * bindings/cxx/dirfile.cpp (Dirfile::Flags Dirfile::VerbosePrefix)
+ bindings/python/pydirfile.c (gdpy_dirfile_getflags gdpy_dirfile_setflags
+ gdpy_dirfile_verbose_prefix) bindings/perl/simple_funcs.xsin (flags
+ verbose_prefix) bindings/f77/fgetdata.c (GDFLAG GDVBPX)
+ bindings/f77/getdata.f90.in (fgd_flags fgd_verbose_prefix)
+ bindings/idl/getdata.c (gdidl_flags gdidl_verbose_prefix): Added.
+ * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+ bindings/perl/test/big_test.t bindings/f77/test/big_test.f
+ bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests
+ 235, 236.
+
+ * src/open.c (_GD_Open): Reset errno to prevent spurious error messages.
+
+ * src/flush.c (_GD_FlushFragment): Avoid FPE.
+
+ * test/global_flags.c test/error_verbose.c test/error_verbose_prefix.c:
+ Added.
+
+ * bindings/idl/getdata.c (gdidl_open): Add missing IGNORE_REFS,
+ PRETTY_PRINT, TRUNCSUB.
+
+ * bindings/f77/fgetdata.c (_GDF_CString): Take care of the malloc'ing rather
+ than forcing the caller to do it.
+
2012-03-16 D. V. Wiebe <ge...@ke...> svn:678
* src/errors.c src/getdata.h.in: Add GD_E_EXISTS
* src/open.c (_GD_CreateDirfile): Replace GD_E_CREAT:GD_E_CREAT_EXCL with
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2012-03-17 02:40:29 UTC (rev 679)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2012-03-20 02:40:21 UTC (rev 680)
@@ -539,3 +539,13 @@
return desync;
}
+
+unsigned long Dirfile::Flags(unsigned long set, unsigned long reset)
+{
+ return gd_flags(D, set, reset);
+}
+
+void Dirfile::VerbosePrefix(const char *prefix) const
+{
+ gd_verbose_prefix(D, prefix);
+}
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-03-17 02:40:29 UTC (rev 679)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-03-20 02:40:21 UTC (rev 680)
@@ -131,6 +131,8 @@
const char *ErrorString();
const char *ErrorString(size_t n) gd_deprecated;
+ unsigned long Flags(unsigned long set = 0, unsigned long reset = 0);
+
const char **FieldList() const;
const char **FieldListByType(EntryType type) const;
@@ -259,6 +261,8 @@
int Validate(const char* field_code) const;
+ void VerbosePrefix(const char *prefix = NULL) const;
+
const char **VectorList() const;
private:
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-17 02:40:29 UTC (rev 679)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-20 02:40:21 UTC (rev 680)
@@ -1658,13 +1658,22 @@
CHECK_OK(234);
CHECK_INT(234, n, 0);
+ // 235: gd_flags check
+ n = d->Flags(GD_PRETTY_PRINT, 0);
+ CHECK_OK(235);
+ CHECK_INT(235, n, GD_PRETTY_PRINT);
+ // 236: gd_verbose_prefix
+ d->VerbosePrefix("big_test: ");
+ CHECK_OK(236);
+
+
// ===================================================================
d->Discard();
delete d;
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2012-03-17 02:40:29 UTC (rev 679)
+++ trunk/getdata/bindings/f77/fgetdata.c 2012-03-20 02:40:21 UTC (rev 680)
@@ -64,18 +64,25 @@
}
/* make a C string */
-static char* _GDF_CString(char* out, const char* in, int l)
+static char *_GDF_CString(char **out, const char *in, int l)
{
int i;
dtrace("%p, %p, %i", out, in, l);
+ if (l < 0) {
+ *out = NULL;
+ dreturn("%p", NULL);
+ return *out;
+ }
+
+ *out = (char*)malloc(l + 1);
for (i = 0; i < l; ++i)
- out[i] = in[i];
- out[l] = '\0';
+ (*out)[i] = in[i];
+ (*out)[l] = '\0';
- dreturn("\"%s\"", out);
- return out;
+ dreturn("\"%s\"", *out);
+ return *out;
}
/* convert an int to a DIRFILE* */
@@ -216,11 +223,11 @@
void F77_FUNC(gdopen, GDOPEN) (int* dirfile, const char* dirfilename,
const int* dirfilename_l, const int* flags)
{
+ char *out;
+
dtrace("%p, %p, %i, %i", dirfile, dirfilename, *dirfilename_l, *flags);
- char* out = (char *)malloc(*dirfilename_l + 1);
-
- *dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(out, dirfilename,
+ *dirfile = _GDF_SetDirfile(gd_open(_GDF_CString(&out, dirfilename,
*dirfilename_l), *flags));
free(out);
@@ -251,8 +258,8 @@
if (field_code_l == 0)
gd_flush(_GDF_GetDirfile(*dirfile), NULL);
else {
- char *out = (char *)malloc(*field_code_l + 1);
- gd_flush(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ char *out;
+ gd_flush(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l));
free(out);
}
@@ -267,13 +274,13 @@
const int* num_frames, const int* num_samples, const int* return_type,
void* data_out)
{
+ char *out;
+
dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%x, %p", n_read, *dirfile,
field_code, *field_code_l, *first_frame, *first_sample, *num_frames,
*num_samples, *return_type, data_out);
- char* out = (char *)malloc(*field_code_l + 1);
-
- *n_read = gd_getdata(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ *n_read = gd_getdata(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), *first_frame, *first_sample, *num_frames,
*num_samples, (gd_type_t)*return_type, data_out);
free(out);
@@ -286,19 +293,24 @@
{
const char **fl;
size_t len = 0;
- DIRFILE* D = _GDF_GetDirfile(*dirfile);
- unsigned int i, nfields = gd_nfields(D);
+ DIRFILE* D;
+ unsigned int i, nfields;
- if (D->error)
- return;
+ dtrace("%p, %i", max, *dirfile);
- fl = gd_field_list(D);
+ D = _GDF_GetDirfile(*dirfile);
+ nfields = gd_nfields(D);
- for (i = 0; i < nfields; ++i)
- if (strlen(fl[i]) > len)
- len = strlen(fl[i]);
+ if (!D->error) {
+ fl = gd_field_list(D);
+ for (i = 0; i < nfields; ++i)
+ if (strlen(fl[i]) > len)
+ len = strlen(fl[i]);
+ }
+
*max = len;
+ dreturn("%i", *max);
}
/* Return the maximum field name length for a meta list */
@@ -309,26 +321,25 @@
unsigned int i, nfields;
size_t len = 0;
DIRFILE* D = _GDF_GetDirfile(*dirfile);
- char* pa = (char *)malloc(*parent_l + 1);
+ char *pa;
- _GDF_CString(pa, parent, *parent_l);
+ dtrace("%p, %i, %p, %i", max, *dirfile, parent, *parent_l);
+ _GDF_CString(&pa, parent, *parent_l);
nfields = gd_nmfields(D, pa);
- if (D->error) {
- free(pa);
- return;
+ if (!D->error) {
+ fl = gd_mfield_list(D, pa);
+
+ for (i = 0; i < nfields; ++i)
+ if (strlen(fl[i]) > len)
+ len = strlen(fl[i]);
}
- fl = gd_mfield_list(D, pa);
-
- for (i = 0; i < nfields; ++i)
- if (strlen(fl[i]) > len)
- len = strlen(fl[i]);
-
*max = len;
free(pa);
+ dreturn("%i", *max);
}
/* gd_field_list wrapper -- this only returns one field name */
@@ -336,16 +347,21 @@
const int* field_num)
{
const char** fl;
- DIRFILE* D = _GDF_GetDirfile(*dirfile);
- unsigned int nfields = gd_nfields(D);
- if (D->error)
- return;
+ DIRFILE* D;
+ unsigned int nfields;
- if (*field_num > 0 && *field_num <= (int)nfields) {
+ dtrace("%p, %p, %i, %i", name, name_l, *dirfile, *field_num);
+
+ D = _GDF_GetDirfile(*dirfile);
+ nfields = gd_nfields(D);
+
+ if (!D->error && *field_num > 0 && *field_num <= (int)nfields) {
fl = gd_field_list(D);
_GDF_FString(name, name_l, fl[*field_num - 1]);
} else
*name_l = 0;
+
+ dreturn("%i", *name_l);
}
/* gd_mfield_list wrapper -- this only returns one field name */
@@ -355,23 +371,23 @@
const char** fl;
unsigned int nfields;
DIRFILE* D = _GDF_GetDirfile(*dirfile);
- char* pa = (char *)malloc(*parent_l + 1);
+ char *pa;
- _GDF_CString(pa, parent, *parent_l);
+ dtrace("%p, %p, %i, %p, %i, %i", name, name_l, *dirfile, parent, *parent_l,
+ *field_num);
+ _GDF_CString(&pa, parent, *parent_l);
nfields = gd_nmfields(D, pa);
- if (D->error) {
- free(pa);
- return;
- }
- if (*field_num > 0 && *field_num <= (int)nfields) {
+ if (!D->error && *field_num > 0 && *field_num <= (int)nfields) {
fl = gd_mfield_list(D, pa);
_GDF_FString(name, name_l, fl[*field_num - 1]);
} else
*name_l = 0;
free(pa);
+
+ dreturn("%i", *name_l);
}
/* gd_nfields wrapper */
@@ -384,20 +400,28 @@
void F77_FUNC(gdgbof, GDGBOF) (int* bof, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char *fc = (char *)malloc(*field_code_l + 1);
- *bof = gd_bof(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ char* fc;
+ dtrace("%p, %i, %p, %i", bof, *dirfile, field_code, *field_code_l);
+
+ *bof = gd_bof(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l));
+
free(fc);
+ dreturn("%i", *bof);
}
/* gd_eof wrapper */
void F77_FUNC(gdgeof, GDGEOF) (int* eof, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char *fc = (char *)malloc(*field_code_l + 1);
- *eof = gd_eof(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ char *fc;
+ dtrace("%p, %i, %p, %i", eof, *dirfile, field_code, *field_code_l);
+
+ *eof = gd_eof(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l));
free(fc);
+
+ dreturn("%i", *eof);
}
/* gd_nframes wrapper */
@@ -410,10 +434,13 @@
void F77_FUNC(gdgspf, GDGSPF) (int* spf, const int* dirfile,
const char* field_code, const int* field_code_l)
{
- char* out = (char *)malloc(*field_code_l + 1);
+ char* out;
+ dtrace("%p, %i, %p, %i", spf, *dirfile, field_code, *field_code_l);
+
*spf = gd_spf(_GDF_GetDirfile(*dirfile),
- _GDF_CString(out, field_code, *field_code_l));
+ _GDF_CString(&out, field_code, *field_code_l));
free(out);
+ dreturn("%i", *spf);
}
/* gd_putdata wrapper */
@@ -422,13 +449,13 @@
const int* first_sample, const int* num_frames, const int* num_samples,
const int* data_type, const void* data_in)
{
+ char *out;
dtrace("%p, %i, %p, %i, %i, %i, %i, %i, 0x%x, %p", n_wrote, *dirfile,
field_code, *field_code_l, *first_frame, *first_sample, *num_frames,
*num_samples, *data_type, data_in);
- char* out = (char *)malloc(*field_code_l + 1);
- *n_wrote = gd_putdata(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
- *field_code_l), *first_frame, *first_sample, *num_frames,
+ *n_wrote = gd_putdata(_GDF_GetDirfile(*dirfile), _GDF_CString(&out,
+ field_code, *field_code_l), *first_frame, *first_sample, *num_frames,
*num_samples, (gd_type_t)*data_type, data_in);
free(out);
@@ -477,9 +504,7 @@
dtrace("%p, %i, %p, %i", type, *dirfile, field_code, *field_code_l);
- fc = (char *)malloc(*field_code_l + 1);
-
- *type = (int)gd_entry_type(_GDF_GetDirfile(*dirfile), _GDF_CString(fc,
+ *type = (int)gd_entry_type(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc,
field_code, *field_code_l));
free(fc);
@@ -497,9 +522,7 @@
dtrace("%p, %p, %p, %i, %p, %i", spf, dtype, fragment_index, *dirfile,
field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_RAW_ENTRY)
*spf = 0;
else {
@@ -530,9 +553,7 @@
infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code,
*field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_LINCOM_ENTRY)
*nfields = 0;
else {
@@ -577,9 +598,7 @@
infield3, infield3_l, m3, b3, fragment_index, *dirfile, field_code,
*field_code_l);
- fc = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), &E))
*nfields = 0;
else if (E.field_type != GD_LINCOM_ENTRY) {
@@ -625,9 +644,7 @@
infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile,
field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
*poly_ord = 0;
else {
@@ -669,9 +686,7 @@
infield, *infield_l, a0, a1, a2, a3, a4, a5, fragment_index, *dirfile,
field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_POLYNOM_ENTRY)
*poly_ord = 0;
else {
@@ -712,9 +727,7 @@
dtrace("%p, %i, %p, %i, %p, %i, %p, %i", in_field, *in_field_l, table,
*table_l, fragment_index, *dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_LINTERP_ENTRY)
*in_field_l = 0;
else {
@@ -739,9 +752,7 @@
dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum,
numbits, fragment_index, *dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_BIT_ENTRY)
*in_field_l = 0;
else {
@@ -767,9 +778,7 @@
dtrace("%p, %i, %p, %p, %p, %i, %p, %i", in_field, *in_field_l, bitnum,
numbits, fragment_index, *dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_SBIT_ENTRY)
*in_field_l = 0;
else {
@@ -796,9 +805,7 @@
in_field2, *in_field2_l, fragment_index, *dirfile, field_code,
*field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_MULTIPLY_ENTRY)
*in_field1_l = 0;
else {
@@ -824,9 +831,7 @@
in_field2, *in_field2_l, fragment_index, *dirfile, field_code,
*field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_DIVIDE_ENTRY)
*in_field1_l = 0;
else {
@@ -854,9 +859,7 @@
check_field, *check_field_l, windop, ithreshold, rthreshold,
fragment_index, *dirfile, field_code, *field_code_l);
- fc = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), &E) || E.field_type != GD_WINDOW_ENTRY)
*in_field_l = 0;
else {
@@ -898,9 +901,7 @@
count_field, *count_field_l, val, max, fragment_index, *dirfile,
field_code, *field_code_l);
- fc = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), &E) || E.field_type != GD_MPLEX_ENTRY)
*in_field_l = 0;
else {
@@ -928,9 +929,7 @@
dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, dividend,
fragment_index, *dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_RECIP_ENTRY)
*in_field_l = 0;
else {
@@ -955,9 +954,7 @@
dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, cdividend,
fragment_index, *dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_RECIP_ENTRY)
*in_field_l = 0;
else {
@@ -983,9 +980,7 @@
dtrace("%p, %i, %p, %p, %i, %p, %i", in_field, *in_field_l, shift,
fragment_index, *dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_PHASE_ENTRY)
*in_field_l = 0;
else {
@@ -1009,9 +1004,7 @@
dtrace("%p, %p, %i, %p, %i", data_type, fragment_index, *dirfile, field_code,
*field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_CONST_ENTRY)
*data_type = 0;
else {
@@ -1035,9 +1028,7 @@
dtrace("%p, %p, %p, %i, %p, %i", data_type, array_len, fragment_index,
*dirfile, field_code, *field_code_l);
- out = (char *)malloc(*field_code_l + 1);
-
- if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ if (gd_entry(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), &E) || E.field_type != GD_CARRAY_ENTRY)
*data_type = 0;
else {
@@ -1055,13 +1046,12 @@
void F77_FUNC(gdfrgi, GDFRGI) (int* fragment_index, const int* dirfile,
const char* field_code, const int* field_code_l)
{
+ char *fc;
dtrace("%p, %i, %p, %i", fragment_index, *dirfile, field_code,
*field_code_l);
- char* fc = (char *)malloc(*field_code_l + 1);
-
*fragment_index = gd_fragment_index(_GDF_GetDirfile(*dirfile),
- _GDF_CString(fc, field_code, *field_code_l));
+ _GDF_CString(&fc, field_code, *field_code_l));
free(fc);
@@ -1073,11 +1063,16 @@
const int* field_code_l, const int* data_type, const int* spf,
const int* fragment_index)
{
- char* out = (char *)malloc(*field_code_l + 1);
- gd_add_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(out, field_code,
+ char *out;
+
+ dtrace("%i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+ *data_type, *spf, *fragment_index);
+
+ gd_add_raw(_GDF_GetDirfile(*dirfile), _GDF_CString(&out, field_code,
*field_code_l), (gd_type_t)(*data_type), (gd_spf_t)*spf,
*fragment_index);
free(out);
+ dreturnvoid();
}
/* gd_add_lincom wrapper */
@@ -1088,39 +1083,42 @@
const double* b2, const char* in_field3, const int* in_field3_l,
const double* m3, const double* b3, const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
+ char *fc;
char* in_fields[3] = {NULL, NULL, NULL};
double m[3] = {0, 0, 0};
double b[3] = {0, 0, 0};
- int nf = *n_fields;
+ const int nf = *n_fields;
+ dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p, %i",
+ *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l,
+ m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3,
+ *fragment_index);
+
if (nf > 0) {
- in_fields[0] = (char *)malloc(*in_field1_l + 1);
- _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ _GDF_CString(in_fields, in_field1, *in_field1_l);
m[0] = *m1;
b[0] = *b1;
}
if (nf > 1) {
- in_fields[1] = (char *)malloc(*in_field2_l + 1);
- _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
m[1] = *m2;
b[1] = *b2;
}
if (nf > 2) {
- in_fields[2] = (char *)malloc(*in_field3_l + 1);
- _GDF_CString(in_fields[2], in_field3, *in_field3_l);
+ _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
m[2] = *m3;
b[2] = *b3;
}
- gd_add_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ gd_add_lincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), nf, (const char**)in_fields, m, b, *fragment_index);
free(fc);
free(in_fields[0]);
free(in_fields[1]);
free(in_fields[2]);
+ dreturnvoid();
}
void F77_FUNC(gdadcl, GDADCL) (const int* dirfile, const char* field_code,
@@ -1131,7 +1129,7 @@
const GD_DCOMPLEXP(m3), const GD_DCOMPLEXP(b3),
const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
+ char *fc;
char* in_fields[3] = {NULL, NULL, NULL};
#ifdef GD_NO_C99_API
double cm[6] = {0, 0, 0, 0, 0, 0};
@@ -1140,35 +1138,38 @@
double complex cm[3] = {0, 0, 0};
double complex cb[3] = {0, 0, 0};
#endif
- int nf = *n_fields;
+ const int nf = *n_fields;
+ dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %i, %p, %p, %p, %i, %p, %p, %i",
+ *dirfile, field_code, *field_code_l, *n_fields, in_field1, *in_field1_l,
+ m1, b1, in_field2, *in_field2_l, m2, b2, in_field3, *in_field3_l, m3, b3,
+ *fragment_index);
+
if (nf > 0) {
- in_fields[0] = (char *)malloc(*in_field1_l + 1);
- _GDF_CString(in_fields[0], in_field1, *in_field1_l);
+ _GDF_CString(in_fields, in_field1, *in_field1_l);
_gd_cp2ca(cm, 0, m1);
_gd_cp2ca(cb, 0, b1);
}
if (nf > 1) {
- in_fields[1] = (char *)malloc(*in_field2_l + 1);
- _GDF_CString(in_fields[1], in_field2, *in_field2_l);
+ _GDF_CString(in_fields + 1, in_field2, *in_field2_l);
_gd_cp2ca(cm, 1, m2);
_gd_cp2ca(cb, 1, b2);
}
if (nf > 2) {
- in_fields[2] = (char *)malloc(*in_field3_l + 1);
- _GDF_CString(in_fields[2], in_field3, *in_field3_l);
+ _GDF_CString(in_fields + 2, in_field3, *in_field3_l);
_gd_cp2ca(cm, 2, m3);
_gd_cp2ca(cb, 2, b3);
}
- gd_add_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ gd_add_clincom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), nf, (const char**)in_fields, cm, cb, *fragment_index);
free(fc);
free(in_fields[0]);
free(in_fields[1]);
free(in_fields[2]);
+ dreturnvoid();
}
/* gd_add_polynom wrapper */
@@ -1178,16 +1179,15 @@
const double* a3, const double* a4, const double* a5,
const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
- char* inf = NULL;
+ char *fc, *inf;
double a[6] = {0, 0, 0, 0, 0, 0};
- int po = *poly_ord;
- if (po > 5)
- po = 5;
+ const int po = (*poly_ord > 5) ? 5 : *poly_ord;
- inf = (char *)malloc(*in_field_l + 1);
- _GDF_CString(inf, in_field, *in_field_l);
+ dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code,
+ *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5);
+ _GDF_CString(&inf, in_field, *in_field_l);
+
switch (po) {
case 5:
a[5] = *a5;
@@ -1202,10 +1202,11 @@
a[0] = *a0;
}
- gd_add_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ gd_add_polynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), po, inf, a, *fragment_index);
free(fc);
free(inf);
+ dreturnvoid();
}
void F77_FUNC(gdadcp, GDADCP) (const int* dirfile, const char* field_code,
@@ -1215,20 +1216,19 @@
const GD_DCOMPLEXP(a4), const GD_DCOMPLEXP(a5),
const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
- char* inf = NULL;
+ char *fc, *inf;
#ifdef GD_NO_C99_API
double ca[12] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
#else
double complex ca[6] = {0, 0, 0, 0, 0, 0};
#endif
- int po = *poly_ord;
- if (po > 5)
- po = 5;
+ const int po = (*poly_ord > 5) ? 5 : *poly_ord;
- inf = (char *)malloc(*in_field_l + 1);
- _GDF_CString(inf, in_field, *in_field_l);
+ dtrace("%i, %p, %i, %i, %p, %i, %p, %p, %p, %p, %p, %p", *dirfile, field_code,
+ *field_code_l, *poly_ord, in_field, *in_field_l, a0, a1, a2, a3, a4, a5);
+ _GDF_CString(&inf, in_field, *in_field_l);
+
switch (po) {
case 5:
_gd_cp2ca(ca, 5, a5);
@@ -1243,10 +1243,11 @@
_gd_cp2ca(ca, 0, a0);
}
- gd_add_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
+ gd_add_cpolynom(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), po, inf, ca, *fragment_index);
free(fc);
free(inf);
+ dreturnvoid();
}
/* gd_add_linterp wrapper */
@@ -1254,16 +1255,18 @@
const int* field_code_l, const char* in_field, const int* in_field_l,
const char* table, const int* table_l, const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
- char* in = (char *)malloc(*in_field_l + 1);
- char* tab = (char *)malloc(*table_l + 1);
+ char *fc, *in, *tab;
- gd_add_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
- *field_code_l), _GDF_CString(in, in_field, *in_field_l),
- _GDF_CString(tab, table, *table_l), *fragment_index);
+ dtrace("%i, %p, %i, %p, %i, %p, %i, %i", *dirfile, field_code, *field_code_l,
+ in_field, *in_field_l, table, *table_l, *fragment_index);
+
+ gd_add_linterp(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+ *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
+ _GDF_CString(&tab, table, *table_l), *fragment_index);
free(fc);
free(in);
free(tab);
+ dreturnvoid();
}
/* gd_add_bit wrapper */
@@ -1271,14 +1274,17 @@
const int* field_code_l, const char* in_field, const int* in_field_l,
const int* bitnum, const int* numbits, const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
- char* in = (char *)malloc(*in_field_l + 1);
+ char *fc, *in;
- gd_add_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
- *field_code_l), _GDF_CString(in, in_field, *in_field_l),
+ dtrace("%i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+ in_field, *in_field_l, *bitnum, *numbits, *fragment_index);
+
+ gd_add_bit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+ *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
(gd_bit_t)*bitnum, (gd_bit_t)*numbits, *fragment_index);
free(fc);
free(in);
+ dreturnvoid();
}
/* gd_add_sbit wrapper */
@@ -1286,14 +1292,17 @@
const int* field_code_l, const char* in_field, const int* in_field_l,
const int* bitnum, const int* numbits, const int* fragment_index)
{
- char* fc = (char *)malloc(*field_code_l + 1);
- char* in = (char *)malloc(*in_field_l + 1);
+ char *fc, *in;
- gd_add_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(fc, field_code,
- *field_code_l), _GDF_CString(in, in_field, *in_field_l),
+ dtrace("%i, %p, %i, %p, %i, %i, %i, %i", *dirfile, field_code, *field_code_l,
+ in_field, *in_field_l, *bitnum, *numbits, *fragment_index);
+
+ gd_add_sbit(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
+ *field_code_l), _GDF_CString(&in, in_field, *in_field_l),
(gd_bit_t)*bitnum, (gd_bit_t)*numbits, *fragment_index);
free(fc);
free(in);
+ dreturnvoid();
}
/* gd_add_multiply wrapper */
@@ -1301,17 +1310,19 @@
const int* field_code_l, const char* in_field1, const int* in_field1_l,
...
[truncated message content] |
|
From: <ket...@us...> - 2012-03-22 01:39:55
|
Revision: 683
http://getdata.svn.sourceforge.net/getdata/?rev=683&view=rev
Author: ketiltrout
Date: 2012-03-22 01:39:48 +0000 (Thu, 22 Mar 2012)
Log Message:
-----------
* Fix SIE truncation.
* Make return_type and num_{frames,samples} optional in Python's dirfile.getdata().
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/src/globals.c
trunk/getdata/src/sie.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-21 00:21:47 UTC (rev 682)
+++ trunk/getdata/ChangeLog 2012-03-22 01:39:48 UTC (rev 683)
@@ -1,3 +1,9 @@
+2012-03-22 D. V. Wiebe <ge...@ke...> svn:683
+ * src/sie.c (_GD_SampIndWrite): Fix file size calculation during truncation.
+
+ * bindings/python/pydirfile.c (gdpy_dirfile_getdata): Make return_type and
+ num_<foo> optional.
+
2012-03-16 D. V. Wiebe <ge...@ke...> svn:680
* src/globals.c (gd_flags gd_verbose_prefix): Added.
* src/errors.c (_GD_SetError): Print verbose prefix, if present.
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2012-03-21 00:21:47 UTC (rev 682)
+++ trunk/getdata/bindings/python/pydirfile.c 2012-03-22 01:39:48 UTC (rev 683)
@@ -575,6 +575,7 @@
const char* field_code;
PY_LONG_LONG first_frame = 0, first_sample = 0;
PyObject *num_frames_obj = NULL, *num_samples_obj = NULL;
+ PyObject *return_type_obj = NULL;
long int num_frames = 0, num_samples = 0;
int as_list = 0;
gd_type_t return_type;
@@ -585,22 +586,32 @@
#endif
if (!PyArg_ParseTupleAndKeywords(args, keys,
- "si|LLOOi:pygetdata.dirfile.getdata", keywords, &field_code,
- &return_type, &first_frame, &first_sample, &num_frames_obj,
+ "s|OLLOOi:pygetdata.dirfile.getdata", keywords, &field_code,
+ &return_type_obj, &first_frame, &first_sample, &num_frames_obj,
&num_samples_obj, &as_list))
{
dreturn("%p", NULL);
return NULL;
}
-
- /* sanity check */
- if (num_frames_obj == NULL && num_samples_obj == NULL) {
- PyErr_SetString(PyExc_ValueError, "pygetdata.dirfile.gd_getdata(): at "
- "least one of num_frames and num_samples must be specified");
+
+ /* get return type */
+ if (return_type_obj) {
+ return_type = (gd_type_t)PyInt_AsLong(return_type_obj);
+ if (PyErr_Occurred()) {
dreturn("%p", NULL);
return NULL;
+ }
+ } else {
+ return_type = gd_native_type(self->D, field_code);
+ PYGD_CHECK_ERROR(self->D, NULL);
}
+ /* get num frames/samples */
+ if (num_frames_obj == NULL && num_samples_obj == NULL) {
+ num_frames = gd_nframes(self->D);
+ PYGD_CHECK_ERROR(self->D, NULL);
+ }
+
if (num_frames_obj) {
num_frames = PyInt_AsLong(num_frames_obj);
if (num_frames == -1 && PyErr_Occurred()) {
@@ -2708,7 +2719,7 @@
"and values, unlike the C API counterpart."
},
{"getdata", (PyCFunction)gdpy_dirfile_getdata, METH_VARARGS | METH_KEYWORDS,
- "getdata(field_code, return_type [, first_frame, first_sample,\n"
+ "getdata(field_code [, return_type, first_frame, first_sample,\n"
"num_frames, num_samples, as_list])\n\n"
"Retrieve a data vector from the dirfile. If NumPy support is\n"
"present in pygetdata, and 'as_list' is not given or zero, a NumPy\n"
@@ -2721,12 +2732,16 @@
"indicated. For list data it should be (typically) one of:\n"
"pygetdata.INT, pygetdata.LONG, pygetdata.ULONG, pygetdata.FLOAT, or\n"
"pygetdata.COMPLEX, although any GetData data type code is permitted.\n"
+ "If omitted, the return type defaults to the native type of the field\n"
+ "(see dirfile.native_type()).\n\n"
+ /* ------- handy ruler ---------------------------------------------| */
"The 'first_frame' and 'first_sample' parameters indicate first\n"
"datum to read. If they are both omitted, data is read from the\n"
"first sample. Similarly, 'num_frames' and 'num_samples' indicate\n"
- "the amount of data. Omitting both of these results in an error.\n"
- "Fewer samples than requested may be returned without causing an\n"
- "error. See gd_getdata(3)."
+ "the amount of data. Omitting both is equivalent to setting\n"
+ "'num_frames' to dirfile.nframes (ie. all available data). Fewer\n"
+ "samples than requested may be returned without causing an error.\n"
+ "See gd_getdata(3)."
},
{ "entry", (PyCFunction)gdpy_dirfile_getentry,
METH_VARARGS | METH_KEYWORDS,
@@ -3137,7 +3152,6 @@
{"verbose_prefix", (PyCFunction)gdpy_dirfile_verbose_prefix,
METH_VARARGS | METH_KEYWORDS, "verbose_prefix([prefix])\n\n"
"Set the verbose prefix to prefix (if given) or else remove the\n"
- /* ------- handy ruler ---------------------------------------------| */
"previously defined prefix. See gd_verbose_prefix (3)."
},
{ NULL, NULL, 0, NULL }
Modified: trunk/getdata/src/globals.c
===================================================================
--- trunk/getdata/src/globals.c 2012-03-21 00:21:47 UTC (rev 682)
+++ trunk/getdata/src/globals.c 2012-03-22 01:39:48 UTC (rev 683)
@@ -118,11 +118,11 @@
unsigned long gd_flags(DIRFILE *D, unsigned long set, unsigned long reset)
gd_nothrow
{
- dtrace("%p, 0x%X, 0x%X", D, set, reset);
+ dtrace("%p, 0x%lX, 0x%lX", D, set, reset);
if (D->flags & GD_INVALID) {
_GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
- dreturn("%p", 0);
+ dreturn("0x%X", 0);
return 0;
}
@@ -134,7 +134,7 @@
D->flags = (D->flags | set) & ~(D->flags & reset);
D->open_flags = (D->open_flags | set) & ~(D->open_flags & reset);
- dreturn("0x%X", D->flags & GD_FLAG_MASK);
+ dreturn("0x%lX", D->flags & GD_FLAG_MASK);
return D->flags & GD_FLAG_MASK;
}
@@ -145,8 +145,8 @@
if (D->flags & GD_INVALID) {
_GD_SetError(D, GD_E_BAD_DIRFILE, 0, NULL, 0, NULL);
- dreturn("%p", 0);
- return 0;
+ dreturn("%i", -1);
+ return -1;
}
_GD_ClearError(D);
@@ -154,7 +154,7 @@
if (prefix) {
ptr = _GD_Strdup(D, prefix);
if (D->error) {
- dreturn("%p", -1);
+ dreturn("%i", -1);
return -1;
}
}
Modified: trunk/getdata/src/sie.c
===================================================================
--- trunk/getdata/src/sie.c 2012-03-21 00:21:47 UTC (rev 682)
+++ trunk/getdata/src/sie.c 2012-03-22 01:39:48 UTC (rev 683)
@@ -288,8 +288,7 @@
}
ssize_t _GD_SampIndWrite(struct _gd_raw_file *restrict file,
- const void *restrict ptr,
- gd_type_t data_type, size_t nelem)
+ const void *restrict ptr, gd_type_t data_type, size_t nelem)
{
ssize_t nrec;
void *p;
@@ -406,11 +405,12 @@
}
/* truncate the file if necessary */
- if (rin < rout)
- if (gd_truncate(fileno(f->fp), nrec - rout + rin)) {
+ if (rin < rout) {
+ if (gd_truncate(fileno(f->fp), (nrec - rout + rin) * size)) {
dreturn("%i", -1);
return -1;
}
+ }
/* update the current record */
memcpy(f->d, (char *)p + (rin - 1) * size, size);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <syn...@us...> - 2012-03-24 13:43:44
|
Revision: 686
http://getdata.svn.sourceforge.net/getdata/?rev=686&view=rev
Author: syntheticpp
Date: 2012-03-24 13:43:33 +0000 (Sat, 24 Mar 2012)
Log Message:
-----------
compile with mingw 4.6
Modified Paths:
--------------
trunk/getdata/cmake/CMakeLists.txt
trunk/getdata/cmake/src/CMakeLists.txt
trunk/getdata/src/fragment.c
trunk/getdata/src/internal.h
trunk/getdata/src/open.c
Modified: trunk/getdata/cmake/CMakeLists.txt
===================================================================
--- trunk/getdata/cmake/CMakeLists.txt 2012-03-24 02:54:17 UTC (rev 685)
+++ trunk/getdata/cmake/CMakeLists.txt 2012-03-24 13:43:33 UTC (rev 686)
@@ -25,26 +25,29 @@
#TODO add configure
add_definitions(
-DPACKAGE_NAME=\"GetData\"
- -DPACKAGE_VERSION=\"0.7.2\"
+ -DPACKAGE_VERSION=\"0.8.0\"
-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")
-set(DEFINE_gd_uint64_t "#define gd_int64_t __uint64")
if(MSVC)
+ ## Substitutions needed to build getdata.h
+ # build in ANSI C mode
+ set(DEFINE_GD_NO_C99_API "#define GD_NO_C99_API")
+
+ 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")
+ set(DEFINE_gd_uint64_t "#define gd_uint64_t __uint64")
+
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
add_definitions(
-D__MSVCRT__
@@ -75,6 +78,11 @@
endif()
if(MINGW)
+ set(DEFINE_gd_int16_t "#define gd_int16_t __int16")
+ set(DEFINE_gd_uint16_t "#define gd_uint16_t unsigned __int16")
+ set(DEFINE_gd_int64_t "#define gd_int64_t __int64")
+ set(DEFINE_gd_uint64_t "#define gd_uint64_t unsigned __int64")
+
add_definitions(
-D__MSVCRT__
-D__MSVCRT_VERSION__=0x0601
@@ -94,10 +102,18 @@
-DHAVE_STRUCT___STAT64
-DHAVE__GETCWD
-DMKDIR_NO_MODE
+ -DHAVE_SYS_FILE_H
+ -DHAVE_SYS_STAT_H
+ -DHAVE_DIRENT_H
+ -DS_IFLNK=0xa000
+ -DHAVE_DECL_OFFSETOF
+ -DHAVE__CHSIZE
+ -DGD_DIRSEP=0x53
)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
endif()
-set(GD_ENABLE_C99_API 0)
+
configure_file(${GD_DIR}/src/getdata.h.in ${CMAKE_BINARY_DIR}/getdata.h @ONLY)
include_directories(${GD_DIR}/src ${CMAKE_CURRENT_BINARY_DIR})
Modified: trunk/getdata/cmake/src/CMakeLists.txt
===================================================================
--- trunk/getdata/cmake/src/CMakeLists.txt 2012-03-24 02:54:17 UTC (rev 685)
+++ trunk/getdata/cmake/src/CMakeLists.txt 2012-03-24 13:43:33 UTC (rev 686)
@@ -6,6 +6,8 @@
${GD_DIR}/src/lzma.c
${GD_DIR}/src/legacy.c
${GD_DIR}/src/slim.c
+ ${GD_DIR}/src/zzslim.c
+ ${GD_DIR}/src/zzip.c
)
GD_FILES(gd src)
Modified: trunk/getdata/src/fragment.c
===================================================================
--- trunk/getdata/src/fragment.c 2012-03-24 02:54:17 UTC (rev 685)
+++ trunk/getdata/src/fragment.c 2012-03-24 13:43:33 UTC (rev 686)
@@ -313,7 +313,7 @@
/* if we can't open directories, we're stuck with the full path method */
#ifdef GD_NO_DIR_OPEN
- flags |= GD_DESYNC_PATHCECK;
+ flags |= GD_DESYNC_PATHCHECK;
#endif
_GD_ClearError(D);
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-03-24 02:54:17 UTC (rev 685)
+++ trunk/getdata/src/internal.h 2012-03-24 13:43:33 UTC (rev 686)
@@ -60,6 +60,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <stddef.h>
#include <errno.h>
#include <ctype.h>
#include <limits.h>
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2012-03-24 02:54:17 UTC (rev 685)
+++ trunk/getdata/src/open.c 2012-03-24 13:43:33 UTC (rev 686)
@@ -367,9 +367,11 @@
D->dir[0].path = dirfile;
D->ndir = 1;
+#ifndef GD_NO_DIR_OPEN
/* get the mtime */
if (fstat(fd, &statbuf) == 0)
*mtime = statbuf.st_mtime;
+#endif
dreturn("%p", fp);
return fp;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-28 22:38:44
|
Revision: 689
http://getdata.svn.sourceforge.net/getdata/?rev=689&view=rev
Author: ketiltrout
Date: 2012-03-28 22:38:38 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
Word around GCC-3.4 C99 non-compliance.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/configure.ac
trunk/getdata/m4/compiler.m4
trunk/getdata/src/internal.h
trunk/getdata/src/parse.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-27 20:21:36 UTC (rev 688)
+++ trunk/getdata/ChangeLog 2012-03-28 22:38:38 UTC (rev 689)
@@ -1,3 +1,8 @@
+2012-03-28 D. V. Wiebe <ge...@ke...> svn:689
+ * m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Added.
+ * src/parse.c src/internal.h: Work around deficiencies in the GCC-3.4 C99
+ compliance.
+
2012-03-22 D. V. Wiebe <ge...@ke...> svn:683
* src/sie.c (_GD_SampIndWrite): Fix file size calculation during truncation.
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-03-27 20:21:36 UTC (rev 688)
+++ trunk/getdata/configure.ac 2012-03-28 22:38:38 UTC (rev 689)
@@ -471,6 +471,7 @@
echo
AC_C_INLINE
AC_C_RESTRICT
+GD_C_RESTRICT_ARRAY
GD_PROG_CC_WALL
GD_PROG_CC_WEXTRA
@@ -517,9 +518,10 @@
fi
dnl Declare a few feature test macros
-AC_DEFINE([_BSD_SOURCE], [], [ Expose BSD-derived definitions ])
-AC_DEFINE([_SVID_SOURCE], [], [ Expose System V-derived definitions ])
-AC_DEFINE([_POSIX_SOURCE], [], [ Expose POSIX.1-1990 conforming definitions ])
+AC_DEFINE([_GNU_SOURCE], [1], [ Expose GNU extensions ])
+AC_DEFINE([_BSD_SOURCE], [1], [ Expose BSD-derived definitions ])
+AC_DEFINE([_SVID_SOURCE], [1], [ Expose System V-derived definitions ])
+AC_DEFINE([_POSIX_SOURCE], [1], [ Expose POSIX.1-1990 conforming definitions ])
AC_DEFINE([_POSIX_C_SOURCE], [200809L],
[ Expose POSIX:2008 conforming definitions ])
Modified: trunk/getdata/m4/compiler.m4
===================================================================
--- trunk/getdata/m4/compiler.m4 2012-03-27 20:21:36 UTC (rev 688)
+++ trunk/getdata/m4/compiler.m4 2012-03-28 22:38:38 UTC (rev 689)
@@ -251,3 +251,24 @@
[ Define to 1 if you have the type `$1' ])
fi
])
+
+dnl GD_C_RESTRICT_ARRAY
+dnl -----------------------------------------------------------
+dnl Check whether "<type> *restrict foo[]" is allowed.
+AC_DEFUN([GD_C_RESTRICT_ARRAY],[
+dnl do nothing if restrict hasn't been found
+if ! test "x$ac_cv_c_restrict" = "xno"; then
+AC_CACHE_CHECK([whether restrict can be applied to pointer arrays],
+[gd_cv_c_restrict_array],[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+ int foo (int *restrict bar[3]) { return bar[2]; }
+], [])],
+[gd_cv_c_restrict_array="yes"],[gd_cv_c_restrict_array="no"])
+])
+fi
+
+if test "x$gd_cv_c_restrict_array" = "xyes"; then
+AC_DEFINE([GD_RESTRICT_ARRAY_OK], [1],
+[Define to 1 if restrict can used on pointer arrays])
+fi
+])
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-03-27 20:21:36 UTC (rev 688)
+++ trunk/getdata/src/internal.h 2012-03-28 22:38:38 UTC (rev 689)
@@ -168,6 +168,12 @@
#endif
#endif
+#ifdef GD_RESTRICT_ARRAY_OK
+#define gd_restrict_arr restrict
+#else
+#define gd_restrict_arr
+#endif
+
#ifndef PATH_MAX
# ifdef _POSIX_PATH_MAX
# define PATH_MAX _POSIX_PATH_MAX
Modified: trunk/getdata/src/parse.c
===================================================================
--- trunk/getdata/src/parse.c 2012-03-27 20:21:36 UTC (rev 688)
+++ trunk/getdata/src/parse.c 2012-03-28 22:38:38 UTC (rev 689)
@@ -251,7 +251,7 @@
/* _GD_ParseRaw: parse a RAW entry in the format file
*/
static gd_entry_t *_GD_ParseRaw(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -335,7 +335,7 @@
/* _GD_ParseLincom: parse a LINCOM entry in the format file.
*/
static gd_entry_t *_GD_ParseLincom(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -434,7 +434,7 @@
/* _GD_ParseLinterp: parse a LINTERP entry in the format file.
*/
static gd_entry_t *_GD_ParseLinterp(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -500,7 +500,7 @@
/* _GD_ParseMultiply: parse MULTIPLY entry in format file.
*/
static gd_entry_t *_GD_ParseMultiply(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -563,7 +563,7 @@
/* _GD_ParseRecip: parse RECIP entry in format file.
*/
static gd_entry_t *_GD_ParseRecip(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -631,7 +631,7 @@
/* _GD_ParseWindow: parse WINDOW entry in format file.
*/
static gd_entry_t *_GD_ParseWindow(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -720,7 +720,7 @@
/* _GD_ParseMplex: parse MPLEX entry in format file.
*/
static gd_entry_t *_GD_ParseMplex(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -795,7 +795,7 @@
/* _GD_ParseDivide: parse DIVIDE entry in format file.
*/
static gd_entry_t *_GD_ParseDivide(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -859,7 +859,7 @@
/* _GD_ParseBit: parse BIT entry in format file.
*/
static gd_entry_t *_GD_ParseBit(DIRFILE *restrict D, int is_signed,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -940,7 +940,7 @@
/* _GD_ParsePhase: parse PHASE entry in formats file.
*/
static gd_entry_t *_GD_ParsePhase(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -1008,7 +1008,7 @@
/* _GD_ParsePolynom: parse a POLYNOM in the format file.
*/
static gd_entry_t *_GD_ParsePolynom(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -1118,7 +1118,7 @@
/* _GD_ParseConst: parse CONST entry in formats file.
*/
static gd_entry_t *_GD_ParseConst(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
@@ -1336,7 +1336,7 @@
/* _GD_ParseString: parse STRING entry in formats file.
*/
static gd_entry_t *_GD_ParseString(DIRFILE *restrict D,
- char *restrict in_cols[MAX_IN_COLS], int n_cols,
+ char *gd_restrict_arr in_cols[MAX_IN_COLS], int n_cols,
const gd_entry_t *restrict parent, const char *restrict format_file,
int line, int me, int standards, int pedantic, int *restrict is_dot)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-28 22:55:17
|
Revision: 690
http://getdata.svn.sourceforge.net/getdata/?rev=690&view=rev
Author: ketiltrout
Date: 2012-03-28 22:55:10 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
Minor corrections.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/m4/compiler.m4
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-28 22:38:38 UTC (rev 689)
+++ trunk/getdata/ChangeLog 2012-03-28 22:55:10 UTC (rev 690)
@@ -1,3 +1,7 @@
+2012-03-28 D. V. Wiebe <ge...@ke...> svn:690
+ * m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Fix test program.
+ * bindings/idl/getdata.c (gdidl_alter_mplex): Fix uninitialised variable.
+
2012-03-28 D. V. Wiebe <ge...@ke...> svn:689
* m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Added.
* src/parse.c src/internal.h: Work around deficiencies in the GCC-3.4 C99
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2012-03-28 22:38:38 UTC (rev 689)
+++ trunk/getdata/bindings/idl/getdata.c 2012-03-28 22:55:10 UTC (rev 690)
@@ -5294,7 +5294,7 @@
} KW_RESULT;
KW_RESULT kw;
- kw.in_field1_x = kw.in_field2_x;
+ kw.in_field1_x = kw.in_field2_x = 0;
kw.val = GD_COUNT_MAX;
kw.max = 0;
GDIDL_KW_INIT_ERROR;
Modified: trunk/getdata/m4/compiler.m4
===================================================================
--- trunk/getdata/m4/compiler.m4 2012-03-28 22:38:38 UTC (rev 689)
+++ trunk/getdata/m4/compiler.m4 2012-03-28 22:55:10 UTC (rev 690)
@@ -258,10 +258,10 @@
AC_DEFUN([GD_C_RESTRICT_ARRAY],[
dnl do nothing if restrict hasn't been found
if ! test "x$ac_cv_c_restrict" = "xno"; then
-AC_CACHE_CHECK([whether restrict can be applied to pointer arrays],
+AC_CACHE_CHECK([whether restrict can be applied to pointer array arguments],
[gd_cv_c_restrict_array],[
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
- int foo (int *restrict bar[3]) { return bar[2]; }
+ int *foo (int *restrict bar@<:@3@:>@) { return bar@<:@2@:>@; }
], [])],
[gd_cv_c_restrict_array="yes"],[gd_cv_c_restrict_array="no"])
])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-28 23:06:48
|
Revision: 691
http://getdata.svn.sourceforge.net/getdata/?rev=691&view=rev
Author: ketiltrout
Date: 2012-03-28 23:06:41 +0000 (Wed, 28 Mar 2012)
Log Message:
-----------
Since we're not planning to deal with ReadData files anymore, make our specification of MPLEX conform to the other fields in the Standards. Will require some finagling by anyone who writes a CalSpecs plugin for defile.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/perl/test/big_test.t
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/src/flush.c
trunk/getdata/src/parse.c
trunk/getdata/test/alter_mplex.c
trunk/getdata/test/entry_mplex.c
trunk/getdata/test/entry_mplex_scalar.c
trunk/getdata/test/get_mplex.c
trunk/getdata/test/get_mplex_lb.c
trunk/getdata/test/put_mplex.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/ChangeLog 2012-03-28 23:06:41 UTC (rev 691)
@@ -1,3 +1,14 @@
+2012-03-28 D. V. Wiebe <ge...@ke...> svn:691
+ * src/flush.c (_GD_FieldSpec) src/parse.c (_GD_ParseMplex): Swap order of
+ fields in MPLEX specification.
+
+ * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+ bindings/perl/test/big_test.t bindings/f77/test/big_test.f
+ bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro
+ test/entry_mplex_scalar.c test/get_mplex.c test/alter_mplex.c
+ test/put_mplex.c test/get_mplex_lb.ctest/entry_mplex.c: Update for
+ Standards change.
+
2012-03-28 D. V. Wiebe <ge...@ke...> svn:690
* m4/compiler.m4 (GD_C_RESTRICT_ARRAY): Fix test program.
* bindings/idl/getdata.c (gdidl_alter_mplex): Fix uninitialised variable.
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-03-28 23:06:41 UTC (rev 691)
@@ -141,7 +141,7 @@
"polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n"
"bit BIT data 3 4\n"
"sbit SBIT data 5 6\n"
- "mplex MPLEX sbit data 1 10\n"
+ "mplex MPLEX data sbit 1 10\n"
"mult MULTIPLY data sbit\n"
"div DIVIDE mult bit\n"
"recip RECIP div 6.5;4.3\n"
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/bindings/f77/test/big_test.f 2012-03-28 23:06:41 UTC (rev 691)
@@ -250,7 +250,7 @@
+ const const'
WRITE(1, *) 'bit BIT data 3 4'
WRITE(1, *) 'sbit SBIT data 5 6'
- WRITE(1, *) 'mplex MPLEX sbit data 1 10'
+ WRITE(1, *) 'mplex MPLEX data sbit 1 10'
WRITE(1, *) 'mult MULTIPLY data sbit'
WRITE(1, *) 'phase PHASE data 11'
WRITE(1, *) 'div DIVIDE mult bit'
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2012-03-28 23:06:41 UTC (rev 691)
@@ -249,7 +249,7 @@
write(1, *) 'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const'
write(1, *) 'bit BIT data 3 4'
write(1, *) 'sbit SBIT data 5 6'
- write(1, *) 'mplex MPLEX sbit data 1 10'
+ write(1, *) 'mplex MPLEX data sbit 1 10'
write(1, *) 'mult MULTIPLY data sbit'
write(1, *) 'phase PHASE data 11'
write(1, *) 'div DIVIDE mult bit'
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2012-03-28 23:06:41 UTC (rev 691)
@@ -61,7 +61,7 @@
printf,1,'polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const'
printf,1,'bit BIT data 3 4'
printf,1,'sbit SBIT data 5 6'
-printf,1,'mplex MPLEX sbit data 1 10'
+printf,1,'mplex MPLEX data sbit 1 10'
printf,1,'mult MULTIPLY data sbit'
printf,1,'div DIVIDE mult bit'
printf,1,'recip RECIP div 6.5;4.3'
Modified: trunk/getdata/bindings/perl/test/big_test.t
===================================================================
--- trunk/getdata/bindings/perl/test/big_test.t 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/bindings/perl/test/big_test.t 2012-03-28 23:06:41 UTC (rev 691)
@@ -167,7 +167,7 @@
polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const
bit BIT data 3 4
sbit SBIT data 5 6
-mplex MPLEX sbit data 1 10
+mplex MPLEX data sbit 1 10
mult MULTIPLY data sbit
div DIVIDE mult bit
recip RECIP div 6.5;4.3
Modified: trunk/getdata/bindings/python/test/big_test.py
===================================================================
--- trunk/getdata/bindings/python/test/big_test.py 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/bindings/python/test/big_test.py 2012-03-28 23:06:41 UTC (rev 691)
@@ -108,7 +108,7 @@
"polynom POLYNOM data 1.1 2.2 2.2 3.3;4.4 const const\n"
"bit BIT data 3 4\n"
"sbit SBIT data 5 6\n"
- "mplex MPLEX sbit data 1 10\n"
+ "mplex MPLEX data sbit 1 10\n"
"mult MULTIPLY data sbit\n"
"div DIVIDE mult bit\n"
"recip RECIP div 6.5;4.3\n"
Modified: trunk/getdata/src/flush.c
===================================================================
--- trunk/getdata/src/flush.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/src/flush.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -497,11 +497,10 @@
break;
case GD_MPLEX_ENTRY:
fprintf(stream, " MPLEX%s ", pretty ? " " : "");
- /* NB: these are backwards! */
- _GD_StringEscapeise(stream, E->in_fields[1], 0, permissive, D->standards);
- fputc(' ', stream);
_GD_StringEscapeise(stream, E->in_fields[0], 0, permissive, D->standards);
fputc(' ', stream);
+ _GD_StringEscapeise(stream, E->in_fields[1], 0, permissive, D->standards);
+ fputc(' ', stream);
_GD_WriteConst(D, stream, me, permissive, GD_INT64,
&E->EN(mplex,count_val), E->scalar[0], E->scalar_ind[0], " ");
_GD_WriteConst(D, stream, me, permissive, GD_INT64,
Modified: trunk/getdata/src/parse.c
===================================================================
--- trunk/getdata/src/parse.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/src/parse.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -765,9 +765,8 @@
return NULL;
}
- /* These are backwards! */
- E->in_fields[0] = _GD_Strdup(D, in_cols[3]);
- E->in_fields[1] = _GD_Strdup(D, in_cols[2]);
+ E->in_fields[0] = _GD_Strdup(D, in_cols[2]);
+ E->in_fields[1] = _GD_Strdup(D, in_cols[3]);
E->scalar[0] = _GD_SetScalar(D, in_cols[4], &E->EN(mplex,count_val),
GD_UINT16, format_file, line, E->scalar_ind, NULL, standards, pedantic);
Modified: trunk/getdata/test/alter_mplex.c
===================================================================
--- trunk/getdata/test/alter_mplex.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/test/alter_mplex.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -29,7 +29,7 @@
const char *format_data =
"count RAW UINT8 8\n"
"data RAW UINT8 8\n"
- "mplex MPLEX count data 1 3\n";
+ "mplex MPLEX data count 1 3\n";
unsigned char data_data[256];
unsigned char c[8];
gd_triplet_t threshold;
Modified: trunk/getdata/test/entry_mplex.c
===================================================================
--- trunk/getdata/test/entry_mplex.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/test/entry_mplex.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -49,8 +49,8 @@
CHECKI(n, 0);
CHECKS(E.field, "data");
CHECKX(E.field_type, GD_MPLEX_ENTRY);
- CHECKS(E.in_fields[0], "in2");
- CHECKS(E.in_fields[1], "in1");
+ CHECKS(E.in_fields[0], "in1");
+ CHECKS(E.in_fields[1], "in2");
CHECKI(E.EN(mplex,count_val), 1);
CHECKI(E.EN(mplex,count_max), 2);
gd_free_entry_strings(&E);
Modified: trunk/getdata/test/entry_mplex_scalar.c
===================================================================
--- trunk/getdata/test/entry_mplex_scalar.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/test/entry_mplex_scalar.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -52,8 +52,8 @@
CHECKI(n, 0);
CHECKS(E.field, "data");
CHECKX(E.field_type, GD_MPLEX_ENTRY);
- CHECKS(E.in_fields[0], "in2");
- CHECKS(E.in_fields[1], "in1");
+ CHECKS(E.in_fields[0], "in1");
+ CHECKS(E.in_fields[1], "in2");
CHECKS(E.scalar[0], "a");
CHECKS(E.scalar[1], "b");
CHECKI(E.scalar_ind[0], -1);
Modified: trunk/getdata/test/get_mplex.c
===================================================================
--- trunk/getdata/test/get_mplex.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/test/get_mplex.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -27,7 +27,7 @@
const char *data = "dirfile/data";
const char *count = "dirfile/count";
const char *format_data =
- "mplex MPLEX count data 1 3\n"
+ "mplex MPLEX data count 1 3\n"
"count RAW UINT8 8\n"
"data RAW UINT8 8\n";
unsigned char c[8];
Modified: trunk/getdata/test/get_mplex_lb.c
===================================================================
--- trunk/getdata/test/get_mplex_lb.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/test/get_mplex_lb.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -27,7 +27,7 @@
const char *data = "dirfile/data";
const char *count = "dirfile/count";
const char *format_data =
- "mplex MPLEX count data 2 3\n"
+ "mplex MPLEX data count 2 3\n"
"count RAW UINT8 8\n"
"data RAW UINT8 8\n";
unsigned char c[8];
Modified: trunk/getdata/test/put_mplex.c
===================================================================
--- trunk/getdata/test/put_mplex.c 2012-03-28 22:55:10 UTC (rev 690)
+++ trunk/getdata/test/put_mplex.c 2012-03-28 23:06:41 UTC (rev 691)
@@ -27,7 +27,7 @@
const char *data = "dirfile/data";
const char *count = "dirfile/count";
const char *format_data =
- "mplex MPLEX count data 1 3\n"
+ "mplex MPLEX data count 1 3\n"
"count RAW UINT8 8\n"
"data RAW UINT8 8\n";
unsigned char c[8], d[8];
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-30 06:01:54
|
Revision: 692
http://getdata.svn.sourceforge.net/getdata/?rev=692&view=rev
Author: ketiltrout
Date: 2012-03-30 06:01:48 +0000 (Fri, 30 Mar 2012)
Log Message:
-----------
MSYS fixes.
Modified Paths:
--------------
trunk/getdata/src/open.c
trunk/getdata/test/test.h
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2012-03-28 23:06:41 UTC (rev 691)
+++ trunk/getdata/src/open.c 2012-03-30 06:01:48 UTC (rev 692)
@@ -117,7 +117,9 @@
case S_IFBLK:
case S_IFIFO:
case S_IFCHR:
+#ifdef S_IFLNK
case S_IFLNK:
+#endif
if (root && strcmp(lamb->d_name, "format") == 0) {
/* don't delete the format file; we'll truncate it later */
format_trunc = 1;
Modified: trunk/getdata/test/test.h
===================================================================
--- trunk/getdata/test/test.h 2012-03-28 23:06:41 UTC (rev 691)
+++ trunk/getdata/test/test.h 2012-03-30 06:01:48 UTC (rev 692)
@@ -37,6 +37,12 @@
#define rmdirfile() chmod("dirfile", 0755); system("rm -rf dirfile");
#endif
+/* sleep for WIN32/64 */
+#if defined _WIN32 || defined _WIN64
+#include <windows.h>
+#define sleep(x) Sleep(1000 * (x))
+#endif
+
/* path munging for WIN32/64 */
#if defined _WIN32 || defined _WIN64
#define gd_pathwrite(x,y) do { \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-03-30 06:10:02
|
Revision: 693
http://getdata.svn.sourceforge.net/getdata/?rev=693&view=rev
Author: ketiltrout
Date: 2012-03-30 06:09:55 +0000 (Fri, 30 Mar 2012)
Log Message:
-----------
Pass -fno_backslash to f77.
Modified Paths:
--------------
trunk/getdata/bindings/f77/test/Makefile.am
trunk/getdata/configure.ac
trunk/getdata/m4/compiler.m4
Modified: trunk/getdata/bindings/f77/test/Makefile.am
===================================================================
--- trunk/getdata/bindings/f77/test/Makefile.am 2012-03-30 06:01:48 UTC (rev 692)
+++ trunk/getdata/bindings/f77/test/Makefile.am 2012-03-30 06:09:55 UTC (rev 693)
@@ -28,6 +28,10 @@
F77_WALL=-Wall
endif
+if F77_FNO_BACKSLASH
+F77_FNO_BACKSLASH=-fno-backslash
+endif
+
if INTEL_F77_COMPILER
F77_ASSUME=-assume byterecl
endif
@@ -42,7 +46,7 @@
BUILT_SOUCES = test_getdata.f
-FFLAGS += -I. -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME)
+FFLAGS += -I. -I.. $(F77_WALL) $(F77_WEXTRA) $(F77_ASSUME) $(F77_FNO_BACKSLASH)
FCFLAGS += -I. -I.. $(F77_WALL) $(FC_WEXTRA) $(FC_ASSUME)
F95LDADD=../libf95getdata.la $(F77LDADD)
F77LDADD=../libfgetdata.la
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-03-30 06:01:48 UTC (rev 692)
+++ trunk/getdata/configure.ac 2012-03-30 06:09:55 UTC (rev 693)
@@ -483,6 +483,7 @@
if test "x$make_f77bindings" != "xno"; then
GD_PROG_F77_WALL
GD_PROG_F77_WEXTRA
+ GD_PROG_F77_FNO_BACKSLASH
GD_LANG_F77_COMPILER_INTEL
fi
@@ -986,6 +987,8 @@
AM_CONDITIONAL(CC_WEXTRA, [test "x$gd_cv_prog_cc_wextra" == "xyes"])
AM_CONDITIONAL(CXX_WEXTRA, [test "x$gd_cv_prog_cxx_wextra" == "xyes"])
AM_CONDITIONAL(F77_WEXTRA, [test "x$gd_cv_prog_f77_wextra" == "xyes"])
+AM_CONDITIONAL(F77_FNO_BACKSLASH,
+ [test "x$gd_cv_prog_f77_fno_backslash" == "xyes"])
AM_CONDITIONAL(FC_WEXTRA, [test "x$gd_cv_prog_fc_wextra" == "xyes"])
AM_CONDITIONAL(INTEL_F77_COMPILER,
[test "x$gd_cv_f77_compiler_intel" == "xyes"])
Modified: trunk/getdata/m4/compiler.m4
===================================================================
--- trunk/getdata/m4/compiler.m4 2012-03-30 06:01:48 UTC (rev 692)
+++ trunk/getdata/m4/compiler.m4 2012-03-30 06:09:55 UTC (rev 693)
@@ -101,6 +101,20 @@
FFLAGS=$gd_saved_FFLAGS])
+dnl GD_PROG_F77_FNO_BACKSLASH
+dnl -------------------------------------------------------------
+dnl Check whether the Fotran-77 compiler accepts -fno-backslash
+AC_DEFUN([GD_PROG_F77_FNO_BACKSLASH],
+[gd_saved_FFLAGS=$FFLAGS
+AC_CACHE_CHECK([whether $F77 accepts -fno-backslash],
+gd_cv_prog_f77_fno_backslash, [FFLAGS="-fno-backslash"
+AC_LANG_PUSH([Fortran 77])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [gd_cv_prog_f77_fno_backslash=yes],
+[gd_cv_prog_f77_fno_backslash=no])
+AC_LANG_POP([Fortran 77])])
+FFLAGS=$gd_saved_FFLAGS])
+
+
dnl GD_PROG_FC_WEXTRA
dnl -------------------------------------------------------------
dnl Check whether the free-form Fotran compiler accepts -Wextra
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-04-04 01:53:07
|
Revision: 694
http://getdata.svn.sourceforge.net/getdata/?rev=694&view=rev
Author: ketiltrout
Date: 2012-04-04 01:52:57 +0000 (Wed, 04 Apr 2012)
Log Message:
-----------
* Deprecate gd_bit_t and gd_spf_t; delete gd_count_t. The former two are still defined, but no longer used in the API.
* the count_max parameter to MPLEX is optional.
* Deprecate GD_FLOAT and GD_DOUBLE, and the corresponding symbols in the Standards.
* Finally finished _GD_FiniRawIO.
* Allow the caller to modify the MPLEX lookback length via gd_mplex_lookback().
* gd_tokenise -> gd_strtok to sidestep regional spelling varations.
* Added new gd_entry_list() and gd_nentries() and then made all the other counting and list functions special cases of these.
* Update mans.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/Makefile.am
trunk/getdata/bindings/cxx/bitentry.cpp
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/getdata/bitentry.h
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/getdata/entry.h
trunk/getdata/bindings/cxx/getdata/mplexentry.h
trunk/getdata/bindings/cxx/getdata/rawentry.h
trunk/getdata/bindings/cxx/getdata/sbitentry.h
trunk/getdata/bindings/cxx/mplexentry.cpp
trunk/getdata/bindings/cxx/rawentry.cpp
trunk/getdata/bindings/cxx/sbitentry.cpp
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/fgetdata.h
trunk/getdata/bindings/f77/getdata.f.in
trunk/getdata/bindings/f77/getdata.f90.in
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/make_parameters.c
trunk/getdata/bindings/perl/GetData.xs
trunk/getdata/bindings/perl/Makefile.am
trunk/getdata/bindings/perl/simple_funcs.pl
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/perl/test/big_test.t
trunk/getdata/bindings/perl/typemap
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/bindings/python/pyentry.c
trunk/getdata/bindings/python/pygetdata.c
trunk/getdata/bindings/python/pygetdata.h
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/cmake/CMakeLists.txt
trunk/getdata/doc/list.tests
trunk/getdata/man/Makefile.am
trunk/getdata/man/dirfile-encoding.5
trunk/getdata/man/dirfile-format.5
trunk/getdata/man/dirfile.5
trunk/getdata/man/gd_add_bit.3
trunk/getdata/man/gd_alter_bit.3
trunk/getdata/man/gd_cbopen.3
trunk/getdata/man/gd_entry.3
trunk/getdata/man/gd_getdata.3
trunk/getdata/man/gd_madd_bit.3
trunk/getdata/man/gd_native_type.3
trunk/getdata/man/gd_spf.3
trunk/getdata/src/Makefile.am
trunk/getdata/src/add.c
trunk/getdata/src/close.c
trunk/getdata/src/common.c
trunk/getdata/src/del.c
trunk/getdata/src/encoding.c
trunk/getdata/src/entry.c
trunk/getdata/src/field_list.c
trunk/getdata/src/flimits.c
trunk/getdata/src/flush.c
trunk/getdata/src/fpos.c
trunk/getdata/src/getdata.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/globals.c
trunk/getdata/src/include.c
trunk/getdata/src/index.c
trunk/getdata/src/internal.h
trunk/getdata/src/mod.c
trunk/getdata/src/name.c
trunk/getdata/src/nfields.c
trunk/getdata/src/open.c
trunk/getdata/src/parse.c
trunk/getdata/src/putdata.c
trunk/getdata/src/spf.c
trunk/getdata/test/Makefile.am
trunk/getdata/test/add_mplex.c
trunk/getdata/test/add_mplex_val.c
trunk/getdata/test/add_sort.c
trunk/getdata/test/alias_list.c
trunk/getdata/test/alias_list_alias.c
trunk/getdata/test/alter_mplex.c
trunk/getdata/test/del_carray_deref.c
trunk/getdata/test/del_const_deref.c
trunk/getdata/test/del_const_force.c
trunk/getdata/test/error_verbose.c
trunk/getdata/test/error_verbose_prefix.c
trunk/getdata/test/fragment_name.c
trunk/getdata/test/include.c
trunk/getdata/test/include_affix.c
trunk/getdata/test/include_auto.c
trunk/getdata/test/include_ignore.c
trunk/getdata/test/include_ref.c
trunk/getdata/test/madd_mplex.c
trunk/getdata/test/nframes_spf.c
trunk/getdata/test/parse_alias_meta.c
trunk/getdata/test/parse_include.c
trunk/getdata/test/parse_include_absolute.c
trunk/getdata/test/parse_include_absrel.c
trunk/getdata/test/parse_include_prefix.c
trunk/getdata/test/parse_include_preprefix.c
trunk/getdata/test/parse_include_relabs.c
trunk/getdata/test/parse_include_relrel.c
trunk/getdata/test/parse_include_slash.c
trunk/getdata/test/parse_include_suffix.c
trunk/getdata/test/parse_include_sufsuffix.c
trunk/getdata/test/parse_mplex_ncols.c
trunk/getdata/test/put_zero.c
trunk/getdata/test/spf.c
trunk/getdata/test/spf_alias.c
trunk/getdata/test/spf_alias_meta.c
trunk/getdata/test/spf_alias_missing.c
trunk/getdata/test/spf_divide.c
trunk/getdata/test/spf_lincom.c
trunk/getdata/test/spf_multiply.c
trunk/getdata/test/spf_polynom.c
trunk/getdata/test/spf_recip.c
trunk/getdata/test/spf_recurse.c
trunk/getdata/test/test.h
trunk/getdata/test/version_6_write.c
trunk/getdata/util/dirfile2ascii.c
Added Paths:
-----------
trunk/getdata/man/gd_entry_list.3
trunk/getdata/man/gd_flags.3
trunk/getdata/man/gd_mplex_lookback.3
trunk/getdata/man/gd_nentries.3
trunk/getdata/man/gd_verbose_prefix.3
trunk/getdata/test/elist_alias.c
trunk/getdata/test/elist_hidden.c
trunk/getdata/test/elist_scalar.c
trunk/getdata/test/get_lincom_null.c
trunk/getdata/test/get_mplex_lball.c
trunk/getdata/test/get_mplex_nolb.c
trunk/getdata/test/nentries_alias.c
trunk/getdata/test/nentries_hidden.c
trunk/getdata/test/nentries_scalar.c
trunk/getdata/test/parse_malias_meta.c
trunk/getdata/test/parse_mplex_nomax.c
Removed Paths:
-------------
trunk/getdata/man/gd_field_list.3
trunk/getdata/man/gd_field_list_by_type.3
trunk/getdata/man/gd_mfield_list.3
trunk/getdata/man/gd_mfield_list_by_type.3
trunk/getdata/man/gd_mvector_list.3
trunk/getdata/man/gd_nfields.3
trunk/getdata/man/gd_nfields_by_type.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_vector_list.3
trunk/getdata/src/meta_list.c
trunk/getdata/src/nmeta.c
Property Changed:
----------------
trunk/getdata/test/
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-03-30 06:09:55 UTC (rev 693)
+++ trunk/getdata/ChangeLog 2012-04-04 01:52:57 UTC (rev 694)
@@ -1,3 +1,133 @@
+2012-04-01 D. V. Wiebe <ge...@ke...> svn:694
+ * src/getdata.h.in: Deprecate gd_bit_t and gd_spf_t. Remove gd_count_t.
+ * src/getdata.h.in bindings/make_parameters.c: Remove GD_COUNT_MAX.
+ * cmake/CMakeLists.txt: Remove DEFINE_gd_int16_t and DEFINE_gd_uint16_t.
+ * src/internal.h: Calculate GD_INT_TYPE and GD_UINT_TYPE.
+
+ * src/entry.c (_GD_CalculateEntry) src/flush.c (_GD_FieldSpec) src/getdata.c
+ (_GD_DoMplex) src/putdata.c (_GD_DoMplexOut gd_putdata64) src/del.c
+ (_GD_DeReference) src/parse.c (_GD_ParseMplex _GD_ParseBit) src/mod.c
+ (_GD_Change): Use GD_INT_TYPE when dealing with bitnum, numbits, count_max,
+ and count_val.
+ * src/add.c (gd_add_bit gd_add_sbit gd_add_mplex gd_madd_bit gd_madd_sbit
+ gd_madd_mplex) src/mod.c (gd_alter_bit gd_alter_sbit gd_alter_mplex)
+ bindings/python/pyentry.c (gdpy_entry_setnumbits gdpy_entry_setbitnum
+ gdpy_entry_setcountval gdpy_entry_setcountmax) bindings/cxx/mplexentry.cpp
+ (MplexEntry::MplexEntry MplexEntry::SetCountVal MplexEntry::SetCountMax)
+ bindings/cxx/sbitentry.cpp (SBitEntry::SBitEntry SBitEntry::SetFirstBit
+ SBitEntry::SetNumBits) bindings/cxx/test/big_test.cpp
+ bindings/cxx/bitentry.cpp (BitEntry::BitEntry BitEntry::SetFirstBit
+ BitEntry::SetNumBits) bindings/cxx/getdata/bitentry.h (FirstBit NumBits)
+ bindings/cxx/getdata/entry.h (FirstBit NumBits CountVal CountMax)
+ bindings/cxx/getdata/mplexentry.h (CountVal CountMax)
+ bindings/cxx/getdata/sbitentry.h (FirstBit NumBits) bindings/perl/GetData.xs
+ bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/f77/fgetdata.c
+ (GDADBT GDADSB GDMDBT GDMDSB GDALBT GDALSB) bindings/idl/getdata.c
+ (gdidl_make_idl_entry gdidl_read_idl_entry gdidl_add_mplex gdidl_alter_mplex):
+ gd_bit_t, gd_count_t -> int.
+ * src/fpos.c (_GD_Seek) src/getdata.c (_GD_MultiplyData _GD_CMultiplyData
+ _GD_DivideData _GD_CDivideData _GD_WindowData _GD_CDivideData _GD_MplexData
+ _GD_DoLincom _GD_DoMultiply _GD_DoDivide _GD_DoWindow _GD_DoMplex
+ gd_getdata64) src/putdata.c (_GD_MplexOutData gd_putdata64) src/flimits.c
+ (_GD_GetEOF _GD_GetBOF gd_bof64) src/common.c (_GD_LinterpData
+ _GD_LincomData) src/add.c (gd_add_raw) src/spf.c (_GD_GetSPF gd_spf)
+ src/mod.c (_GD_SPFConvert) src/mod.c (gd_alter_entry) src/index.c
+ (gd_framenum_subset64) bindings/python/pyentry.c (gdpy_entry_setspf)
+ bindings/python/pydirfile.c (gdpy_dirfile_getdata) bindings/cxx/rawentry.cpp
+ (RawEntry::RawEntry RawEntry::SetSamplesPerFrame)
+ bindings/cxx/getdata/rawentry.h (SamplesPerFrame) bindings/perl/GetData.xs
+ bindings/perl/typemap bindings/perl/simple_funcs.pl bindings/f77/fgetdata.c
+ (GDADRW GDALRW) util/dirfile2ascii.c: gd_spf_t -> unsigned int.
+ * src/flush.c (_GD_WriteConst) src/mod.c (_GD_AlterScalar): Add missing
+ integer types.
+
+ * src/parse.c (_GD_ParseMplex): Make count_max optional.
+ * src/getdata.c (_GD_DoMplex) src/add.c (_GD_Add): Handle count_max == 0.
+
+ * src/getdata.h.in: Mark GD_FLOAT and GD_DOUBLE as deprecated.
+
+ * src/encoding.c (_GD_FiniRawIO): Handle short writes and IO errors.
+
+ * src/getdata.c (_GD_DoMplex): use D->lookback to determine how far to
+ search backwards. Also, read data in chunks of size GD_BUFFER_SIZE.
+ * src/open.c (_GD_Open): Initialise D->lookback.
+ * src/globals.c (gd_mplex_lookback): Added.
+ * bindings/cxx/dirfile.cpp (Dirfile::MplexLookback)
+ bindings/perl/simple_funcs.xsin (mplex_lookback) bindings/f77/getdata.f90.in
+ (fgd_mplex_lookback) bindings/f77/fgetdata.c (GDMXLB) bindings/idl/getdata.c
+ (gdidl_mplex_lookback): Added.
+
+ * src/parse.c (gd_strtok): Renamed from gd_tokenise to avoid regional
+ spelling variations. Bindings renamed accordingly (except for the F77
+ bindings).
+
+ * bindings/python/pygetdata.c: Add GD_E_EXISTS exception.
+
+ * bindings/python/pydirfile.h: Add mplex_lookback and verbose_prefix to
+ gdpy_constant_t.
+ * bindings/python/pydirfile.c (gdpy_dirfile_delete): Delete verbose_prefix.
+ * bindings/python/pydirfile.c (gdpy_dirfile_create): Initialise
+ mplex_lookback and verbose_prefix.
+ * bindings/python/pydirfile.c (gdpy_dirfile_verbose_prefix): Deleted.
+ * bindings/python/pydirfile.c (gdpy_dirfile_getverboseprefix
+ gdpy_dirfile_setverboseprefix gdpy_dirfile_getmplexlookback
+ gdpy_dirfile_setmplexlookback): Added.
+
+ * bindings/Makefile.am: add src/gd_config.h to the prerequisites of
+ make_parameters.
+
+ * src/flush.c (_GD_FlushFragment): Write /ENCODING for zzip and zzslim.
+
+ * src/meta_list.c: Merged into src/field_list.c
+ * src/nmeta.c: Merged into src/nfields.c
+
+ * src/add.c (_GD_InvalidEntype): Added.
+ * src/internal.h: Add entry_list and entry_list_flags to DIRFILE and
+ private_entry.
+ * src/internal.h (_GD_EntryIndex): Deleted.
+ * src/field_list.c (_GD_EntryIndex _GD_EntryList gd_entry_list): Added.
+ * src/field_list.c (_GD_ListEntry): Handle GD_ENTRIES_... flags.
+ * src/field_list.c (gd_field_list_by_type gd_vector_list gd_field_list
+ gd_mfield_list_by_type gd_mfield_list): Reimplement via gd_entry_list().
+
+ * src/nfields.c (_GD_NEntries gd_nentries): Added.
+ * src/nfields.c (gd_nfields gd_nvectors gd_nfields_by_type gd_nmfields
+ gd_nmvectors gd_nmfields_by_type): Reimplement via gd_nentries().
+
+ * src/field_list.c (gd_constants gd_carrays gd_strings gd_mconstants
+ gd_mcarrays gd_mstrings): Call _GD_NEntries for counts.
+
+ * src/entry.c (gd_hide gd_unhide) src/del.c (_GD_Delete) src/include.c
+ (gd_uninclude) src/add.c (_GD_Add): Delete count updates.
+
+ * src/name.c (_GD_Rename) src/del.c (_GD_Delete) src/include.c
+ (gd_uninclude) src/add.c (_GD_Add _GD_AddAlias): Invalidate metafield lists
+ too.
+
+ * src/entry.c (_GD_FreeE) src/close.c (_GD_FreeD): Delete entry_lists.
+
+ * src/globals.c (gd_flags): Don't check GD_INVALID.
+
+ * bindings/python/pydirfile.c (gdpy_dirfile_nentries
+ gdpy_dirfile_entrylist) bindings/perl/GetData.xs (entry_list)
+ bindings/cxx/dirfile.cpp (Dirfile::NEntries Dirfile::EntryList)
+ bindings/f77/getdata.f90.in (fgd_nentries fgd_entry_name_max fgd_entry_list)
+ bindings/f77/fgetdata.c (GDNENT GDENTX GDENTN): Added.
+ * bindings/idl/getdata.c (gdidl_get_field_list gdidl_get_nfields)): Convert to
+ bindings for gd_entry_list and gd_nentries.
+
+ * bindings/python/test/big_test.py bindings/cxx/test/big_test.cpp
+ bindings/perl/test/big_test.t bindings/f77/test/big_test.f
+ bindings/f77/test/big_test95.f90 bindings/idl/test/big_test.pro: Add tests
+ 237 through 240.
+
+ * test/elist_alias.c test/elist_hidden.c test/elist_scalar.c
+ test/get_lincom_null.c test/get_mplex_lball.c test/get_mplex_nolb.c
+ test/nentries_alias.c test/nentries_hidden.c test/nentries_scalar.c
+ test/parse_malias_meta.c test/parse_mplex_nomax.c: Added.
+
+ * man/: Updated.
+
2012-03-28 D. V. Wiebe <ge...@ke...> svn:691
* src/flush.c (_GD_FieldSpec) src/parse.c (_GD_ParseMplex): Swap order of
fields in MPLEX specification.
@@ -208,7 +338,7 @@
recreate the format file; just truncate it. (This helps kst not get
confused when monitoring a dirfile which gets truncated.)
-2012-02-14 D. V. Wiebe <ge...@ke...> svn:656,657
+2012-02-14 D. V. Wiebe <ge...@ke...> svn:656 svn:657
* src/putdata.c (gd_putdata): Return early if num_samp == 0.
* test/put_zero.c: Added.
@@ -4375,7 +4505,7 @@
* src/common.c (_GD_GetEntry): Removed FILEFRAM as an alias for INDEX per
discussion with Barth.
-2008-10-10 D. V. Wiebe <ge...@ke...> svn:129
+2008-10-10 D. V. Wiebe <ge...@ke...> svn:128 svn:129
* src/entry.c (_GD_FreeE): Renamed from dirfile_free_entry_strings (for
which a new boilerplate function has been created). Separated cleaning up
internal and externally created entries. Internally, the library now
@@ -4400,7 +4530,7 @@
encoding specific *touch() function.
* src/raw.c (_GD_RawTouch): Added. (Also used for the ASCII encoding).
- * src/meta_list.c: Fixed all functions to get them working.
+ * src/meta_list.c: Added (META version of field_list.c)
* src/field_list.c: Call _GD_ClearError in all public functions.
* src/nmeta.c: Added (META version of nfields.c)
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2012-03-30 06:09:55 UTC (rev 693)
+++ trunk/getdata/NEWS 2012-04-04 01:52:57 UTC (rev 694)
@@ -10,10 +10,13 @@
* 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.
@@ -30,10 +33,13 @@
* 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().
@@ -55,8 +61,10 @@
* BUG FIX: When the parser fails in a gd_include() call, the internal list of
conformant Standards Versions for the loaded dirfile is no longer corrupted.
+
* BUG FIX Performing two consecutive reads of the same field in an ASCII
encoded datasources no longer confuses GetData.
+
* BUG FIX: Numerous memory leaks have been patched (mostly pin-holes, although
there are a few, rare but egregious ones).
@@ -64,9 +72,11 @@
* The value(s) of a CONST or CARRAY field added with gd_[m]add() is now
guaranteed to be zero; previously, it was unspecified.
+
* BUG FIX: Specifying both GD_VERBOSE and GD_IGNORE_DUPS no longer results in
spurious "Field code already defined" messages when duplicate fields are
encountered.
+
* BUG FIX: Calling gd_delete on a metafield no longer results in a segfault.
Bindings Changes:
@@ -80,9 +90,11 @@
* dirfile2ascii now pads reads past the end-of-field. The value used to
pad may be specified with '-z', and defaults to 0/NaN. Previously, the
value of uninitialized memory was output.
+
* BUG FIX: dirfile2ascii now does what the user intends when presented with
cart-before-horse arguments, ie. "dirfile2ascii -e field DIRFILE".
Previously this resulted in confusion.
+
* BUG FIX: dirfile2ascii now accepts field conversion '-u', which was
documented but overlooked in the argument parser.
@@ -96,16 +108,20 @@
types: DIVIDE, which computes X/Y for vectors X and Y, RECIP, which computes
A/X for vector X and scalar A, and CARRAY, which is an array of CONST
scalars. A few other changes are listed below.
+
* Like CONST fields, CARRAY elements can be used as parametersin the
definition of other fields. Syntax is 'field<n>', where 'field' is the
field name and 'n' the element index in the CARRAY (and the angle brackets
are literal angle brackets). If the '<n>' is omitted, the first element
(numbered 0) is assumed.
+
* Slashes on reserved words are now mandatory, allowing fields with reserved
words as names.
+
* The long-deprecated single character data type codes have been removed from
Standards Version 8. (They are still accepted by GetData, which handles
all previous Standards Versions as well.)
+
* The /ENDIAN directive now takes an optional second parameter. The only
allowed value for this second token is "arm", which indicates that double
precision floating point data (including double precision complex data) are
@@ -118,9 +134,11 @@
Win32 using MinGW. In the case of MinGW, this includes linking against the
Microsoft C Runtime, which isn't POSIX compliant. Users should excercise
caution when writing to dirfiles in this case.
+
* GetData can now be used on ARM processors. As a side-effect, GetData can
now read and write the middle-ended floating point format used by older ARM
processors (on any processor, via endianness conversion).
+
* Some changes have been made to the parser. It now operates in one of two
modes: pedantic mode, which adheres strictly to one particular Dirfile
Standards Version, and permissive mode (the default) which is more
@@ -128,51 +146,64 @@
switch the parser from permissive to pedantic mode unless told not to (see
GD_PERMISSIVE below), and will change the particular Standards Version to
which pedantic mode is adhering.
+
* As a result of the previous change, the Standards compliance of the parser
in strict mode has been greatly increased. This affects allowed characters
in field names, and field name lengths. The existance or lack thereof of
the implicit FILEFRAM field (an alias for INDEX) is also affected.
+
* Since Standards Versions 4 and earlier were never codified, we've made some
assumptions as to their behaviour in certain undocumented situtations. Most
noticably, they still prohibit ASCII control codes (bytes < 0x20) and '/'
in field names. We also assume these dirfiles have native byte sex, even
though some early GetData behaviour implied only little-ended data was
acceptable.
+
* Every Dirfile object now records its current Standards Version, which
affects functions such as gd_add_spec(). The Version will start out as the
value of the last /VERSION directive encountered by the parser, or else the
latest compliant Standards Version. It can be changed (see below).
+
* When writing metadata to disk, fragments will be written according to the
current Standards Version of the dirfile object, rather than always using
the latest version, as before.
+
* The C library now sports an "ANSI C" mode, which allows compilation of
GetData without a C99-compliant compiler. Some functionality may be lost,
most prominently, but unsurprisingly, the default (C99) API.
+
* The artificial maximum line length of 4096 bytes for format metadata has
been removed. The maximum line length is now 2**31 bytes on 32-bit systems,
and more on 64-bit systems. This also has the side-effect of removing the
same length limit which had been applied to field names.
+
* LINTERP tables are no longer required to be sorted. The library will
sort them, if needed. As a side-effect of this, tables are no longer read
twice when loading, leading to potential speed-up.
+
* BUG FIX: The library wasn't properly checking that the second and higher
input fields in LINCOM and MULTIPLY fields were, in fact, vectors, leading
to possible segfaults.
+
* BUG FIX: A memory leak associated with modifying LINCOM metadata has been
fixed.
+
* BUG FIX: Using a complex valued vector as the second input field in a
MULTIPLY wouldn't result in the field being internally flagged as complex,
leading to loss of the imaginary part in certain situtaitons.
+
* BUG FIX: Trying to write to a LINTERP via a table which isn't monotonic now
results in error. Previously, this was allowed, with arbitrary data stored
to disk.
+
* BUG FIX: On encountering a line longer than it was prepared to deal with,
the parser used to get very confused, potentially resulting in bizarre
behaviour. On the off chance such a line is encountered, GetData will now
raise GD_E_LINE_TOO_LONG in these cases. (And, since the maxmium line
- length has been increased to at least 2**31 bytes, this should only occur
- in pathological situations.)
+ length has been increased to at least 2**31 characters, this should only
+ occur in pathological situations.)
+
* BUG FIX: Deleting a metafield was not being communicated to its parent,
resulting in differing opinions within the library as to the deleted field's
exsitence.
@@ -184,6 +215,7 @@
performed. All public functions, and data types now begin with 'gd_'. All
public preprocessor macros now begin with 'GD_'. Symbol renaming has
occurred in the following manner:
+
- functions which started with 'put' simply prefix 'gd_' to their name. So
put_constant() becomes gd_put_constant().
- functions which started with 'get' replace 'get' with 'gd', except those
@@ -196,54 +228,71 @@
- macros which started with 'GETDATA_' now start with 'GD_'. Those that
started with 'NO_GETDATA_' now start with 'GD_NO_'. So GETDATA_LEGACY_API
becomes GD_LEGACY_API and NO_GETDATA_LEGACY_API becomes GD_NO_LEGACY_API.
+
* The above renaming rules result in one gd_ namespace clash. As a result,
get_reference() has been removed completely. Calls will have to be
changed to use gd_reference(), formerly dirfile_reference().
+
* Furthermore, the function dirfile_protect() is now gd_alter_protection() to
match the naming of other fragment metadata altering functions.
+
* To ease transition to the new namespace, defining GD_FUNCTION_ALIASES before
including getdata.h will create a bunch of preprocessor macros which map the
old names to the new.
+
* The meaning of the GD_PEDANTIC flag to gd_[cb]open() has changed. It now
forces the parser to start off in pedantic mode (see above), following the
latest Standards Version, rather than the default permissive mode. This is
a subtle change, and in most cases the effects of GD_PEDANTIC will be the
same as they were before.
+
* A new dirfile flag, GD_PERMISSIVE, has been added. Passing this to
gd_[cb]open() will prohibit the parser from switching into pedantic mode
when it encounters a /VERSION directive. This flag is needed to read
dirfiles which claim to adhere to the Standards via a /VERSION directive,
but contain invalid syntax nonetheless.
+
* The current Standards Version of an open dirfile can be set or queried by
calling the new function gd_dirfile_standards(). NB: this only affects the
open dirfile, not the metadata stored on disk.
+
* A new function, gd_rewrite_fragment() will force GetData to write the
specified fragment to disk, even if no metadata in the fragment has changed.
+
* Two new functions, gd_bof() and gd_eof() can be used to find the sample
number of the beginning- or end-of-field for a given field. Notably, these
can be used to calculate the amount of raw data on disk for a given field.
+
* The new gd_invalid_dirfile() function will return a newly created, invalid
dirfile. Primarily useful to callers as a "null dirfile" placeholder.
+
* GD_E_OPEN_INCLUDE has been renamed to GD_E_OPEN_FRAGMENT, but the former
symbol remains as an alias.
+
* Two new bitflags to gd_cbopen and gd_open: GD_ARM_ENDIAN and
GD_NOT_ARM_ENDIAN allow specifying the default ordering of double precision
data. These flags may also be used with gd_alter_endianness() and will be
returned by gd_endianness(). On all platforms except for middle-endian
ARMs, GD_NOT_ARM_ENDIAN equals zero and may be omitted.
+
* Where gd_flush() and gd_metaflush() in the past raised GD_E_OPEN_INCLUDE
on I/O error, they now raise the new GD_FLUSH.
+
* All functions now raise GD_E_DIMENSION when encountering a scalar field
when expecting a vector. In the past, the error value returned was
different for different functions.
+
* getdata.h now wraps itself in an extern "C" block if included by a C++
compiler.
+
* If passed a NULL pointer, gd_error_string() will return a newly malloc'd
buffer long enough to hold the entire string. It should be free'd by the
caller.
+
* The parser data passed to the callback function now includes the length of
the buffer. The parser also permits the callback to assign a new pointer to
the 'line' element of the parser data if the buffer passed in is too small.
+
* gd_metaflush() now fails and raises GD_E_ACCMODE if called on a read-only
dirfile. (Previously it would successfully do nothing.)
@@ -255,39 +304,56 @@
* BUG FIX: In previous versions, attempting to access an invalid dirfile
(anything that would cause gd_open to fail) resulted in leaked memory. This
leak has been plugged.
+
* BUG FIX: A segfault involving the reporting of POLYNOM fields has been fixed
in GetFormat().
Bindings
* Bindings for the functionality introduced into 0.7.0 have been added.
+
* F77: GDPROT has been renamed GDAPRT to mirror the renaming of
gd_alter_protection().
+
* F77: GDGTCO and GDPTCO no longer return an indicator of success.
+
* F77: The signatues of GDGSCA and GDASCA have changed to return/take the
scalar index as well.
+
* F95: For consistency sake, the Fortran 95 bindings have undergone the same
renaming so they have the same name as their C counterparts. All functions
are now preceded by 'fgd_'.
+
* F95: The fgd_get_constant_* and fgd_put_constant_* procedures are now
subroutines, not functions.
+
* C++: Const member functions are now flagged as such.
+
* C++: The len parameter to Dirfile::ErrorString is now ignored.
+
* C++: dirfiles are now opened read-only by default.
+
* IDL: The IDL bindings have also followed suit in the great renaming. The
exception to this is GETDATA_CONSTANTS(), which is not renamed.
+
* IDL: Various constants defined in getdata.h but not used by the IDL bindings
have been removed from the structure returned by GETDATA_CONSTANTS().
- * Pyhon: dirfile.getdata() now raises ValueError if neither num_frames nor
+
+ * Python: dirfile.getdata() now raises ValueError if neither num_frames nor
num_samples are specified. In the past, it would happily return nothing
in this case.
+
* Python: dirfiles are now opened read-only by default.
+
* C++ BUG FIX: Entry::Scalar() no longer rejects valid values of index.
+
* IDL BUG FIX: A memory impropriety involving keyword arguments. This bug
manifested by rejecting valid keyword arguments on 64-bit systems, but may
have had other, subtle effects on 32-bit systems as well.
+
* Python BUG FIX: A non-literal phase shift is now properly reported.
+
* Python BUG FIX: Calling Dirfile.discard() or Dirfile.close() no longer
results in a segfault.
@@ -295,9 +361,11 @@
* The --disable-checkdirfile option has been removed from ./configure. It
is now always installed.
+
* A utility, dirfile2ascii, is now installed alongside checkdirfile. This
utility converts all or part of a dirfile into ASCII text. dirfile2ascii
was written by Matthew Truch.
+
* The thoroughness of the checks done by checkdirfile have increased. It now
reports format syntax errors, Dirfile Standards compliance, problems with
field definitions (such as missing input fiel...
[truncated message content] |
|
From: <ket...@us...> - 2012-04-04 23:47:27
|
Revision: 696
http://getdata.svn.sourceforge.net/getdata/?rev=696&view=rev
Author: ketiltrout
Date: 2012-04-04 23:47:18 +0000 (Wed, 04 Apr 2012)
Log Message:
-----------
Compatibility mode fixes; more doc updates.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/man/Makefile.am
trunk/getdata/man/dirfile-format.5
trunk/getdata/man/gd_delete.3
trunk/getdata/man/gd_rename.3
trunk/getdata/src/add.c
trunk/getdata/src/ascii.c
trunk/getdata/src/common.c
trunk/getdata/src/compat.c
trunk/getdata/src/del.c
trunk/getdata/src/encoding.c
trunk/getdata/src/entry.c
trunk/getdata/src/errors.c
trunk/getdata/src/flimits.c
trunk/getdata/src/fpos.c
trunk/getdata/src/fragment.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/globals.c
trunk/getdata/src/gzip.c
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/name.c
trunk/getdata/src/nframes.c
trunk/getdata/src/open.c
trunk/getdata/src/putdata.c
trunk/getdata/src/sie.c
trunk/getdata/src/zzip.c
trunk/getdata/src/zzslim.c
Added Paths:
-----------
trunk/getdata/man/gd_include_affix.3
Removed Paths:
-------------
trunk/getdata/man/gd_include.3
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/ChangeLog 2012-04-04 23:47:18 UTC (rev 696)
@@ -1,3 +1,6 @@
+2012-04-01 D. V. Wiebe <ge...@ke...> svn:696
+ * src/compat.c (_GD_ReadDir): Renamed from gd_readdir().
+
2012-04-01 D. V. Wiebe <ge...@ke...> svn:694
* src/getdata.h.in: Deprecate gd_bit_t and gd_spf_t. Remove gd_count_t.
* src/getdata.h.in bindings/make_parameters.c: Remove GD_COUNT_MAX.
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/NEWS 2012-04-04 23:47:18 UTC (rev 696)
@@ -1,7 +1,254 @@
New in version 0.8.0a:
- * Some stuff.
+ Dirfile Changes
+ * Dirfile Standards Version 9 has been released. It adds two new field types:
+ MPLEX, which allows multiplexing multiple low-rate channels in one high-rate
+ one, and WINDOW, which extracts a portion of a field based on the value of
+ a second field. More changes are listed below.
+
+ * Alternate field names may be defined using the /ALIAS directive. Aliases
+ can't be used as a parent when defining metafields, but are otherwise
+ indistinguishable from a field's original ("canonical") name.
+
+ * The /VERSION directive now has fragment scope, which should
+
+ * Fields may be "hidden" using the /HIDDEN directive. The Standards don't say
+ what a "hidden" field does, but GetData will, by default, exclude them from
+ the count and list functions.
+
+ * Literal integers in the format may now be specified in octal (using 0####)
+ or hexidecimal (using 0x##### or 0X#####) in addition to decimal.
+
+ * Effects of the /VERSION directive no longer propagate upwards to parent
+ fragments. This makes subdirfile encapsulation easier and fixes the
+ "Version Leak" problem reported with earlier Standards. The effect of this
+ is twofold: "/VERSION 9" never propagates upwards, but neither do the
+ Versions specified in subfragments included in a Version 9 fragment (even if
+ they are earlier Versions).
+
+ * The /INCLUDE directive can take two additional, optional parameters which
+ specify a prefix and/or suffix used to modify the entry names of the fields
+ defined in the included fragment. (The intent of this is to permit the
+ inclusion of multiple subdirfiles which define the same set of fields, by
+ modifying their field names.)
+
+ * Three new encoding schemes are available. The first is the Sample-Index
+ Encoding (SIE), similar to run-length encoding, useful for compressing data
+ which changes very rarely varying data. Like the ASCII encoding, GetData
+ implements it internally, so it's always available. The other two schemes
+ (zzip and zzslim) are based around the ZZip library, an access library for
+ PKWARE ZIP files. These are unusual in that they store all raw data in the
+ same ZIP archive.
+
+ * The /ENCODING directive takes an optional second token. The zzip and zzslim
+ encoding schemes optionally use this token to specify the name of the
+ combined ZIP archive.
+
+ * The data type names FLOAT (an alias for FLOAT32) and DOUBLE (an alias for
+ FLOAT64) have been deprecated.
+
+ Library Changes:
+
+ * On POSIX systems, GetData now caches the dirfile directory (and any other
+ necessary subdirectories). This guards against third-parties renaming the
+ directory while GetData is interested in it.
+
+ * GetData is, in general, more careful about pathname management. At least
+ on POSIX systems, it will now try to canonicalise all paths it comes across,
+ including resolving symlinks. As a result, GetData no longer becomes
+ befuddled by a caller who opens a Dirfile with a relative pathname and then
+ calls chdir(2). Functions like gd_fragmentname() and gd_raw_filename() now
+ return canonicalised paths.
+
+ * The library no longer forces a sync of all raw data on close. The sync
+ causes a flush of filesystem buffers, which is usually unnecessary overhead,
+ and degredatious to efficient disk I/O. Use an explicit gd_sync() or
+ gd_flush() before closing to recover the old behaviour, if desired.
+
+ * The error messages output by GetData with GD_VERBOSE turned on now has
+ "libgetdata: " prefixed to it. A further prefix may be specified by the
+ caller.
+
+ * When truncating a dirfile, the primary format file is no longer deleted and
+ then recreated. Instead, it is simply truncated in-place. This change
+ means that a Dirfile which is undergoing truncation always appears (to
+ GetData, at least) to be a valid Dirfile, which can be useful if it is being
+ concurrently read.
+
+ * Write support for gzip-encoded data has been added. Writes occur out of
+ place, which means sufficient space on the filesystem is needed for a second
+ copy of every field being written. Writing to a gzip compressed field
+ requires uncompressing the portion of the field before the write of the
+ existing file, recompressing it to the temporary file, then writing the new
+ data to the temporary file. A subsequent write at a later position, will
+ continue to write to the compressed file, but a subsequent write to an
+ earlier position requires coping all remaining data from the old file to the
+ temporary file, finalising it, moving it over top of the old file, and then
+ starting afresh with a new temporary file. As a result, it's not very fast,
+ and likely should be avoided for non-sequential writes.
+
+ * Raw data files are now only opened for writing if writing is going to occur.
+ In particular, this means that opening a dirfile with GD_RDWR will still
+ work even if you don't have write access to it, so long as you don't try
+ writing to it.
+
+ * GetData now tracks a "current location" for all RAW files, and allows reads
+ and writes to occur at the "current location" (via the special symbol
+ GD_HERE). For some derived fields the idea of a "current location" doesn't
+ make sense, and won't work.
+
+ * BUG FIX: In previous versions, renaming a field with gd_rename() wouldn't
+ update or invalidate the cache of fields which depended on the old name,
+ leading to surprising results. It will now either invalidate these fields
+ metadata caches or else change the name in those definitions as well.
+
+ * BUG FIX: The invalid syntax "/META parent/child granchild ..." is now
+ properly rejected by the metadata parser. Previously it half-worked,
+ resulting in segfault in gd_close().
+
+ * BUG FIX: Several syntax errors encountered in PHASE and RECIP field
+ specifications weren't being reported by the parser, leading to corrupted
+ metadata on open.
+
+ * BUG FIX: GetData no longer omits the input field to a RECIP when writing
+ metadata to disk.
+
+ * BUG FIX: GetData no longer assumes all fields have the same number of
+ samples-per-frame when computing a LINCOM.
+
+ * BUG FIX: Writing an empty fragment with GD_PRETTY_PRINT turned on no longer
+ results in a floating-point exception.
+
+ * BUG FIX: Renaming a field now properly flags the fragment which contains it
+ as dirty, which will ensure the rename is writen to disk when the metadata
+ are next flushed.
+
+ * BUG FIX: Whitespace within tokens is now properly escaped when metadata is
+ flushed to disk.
+
+ * BUG FIX: The parser no longer gets tripped up by two character escape
+ sequences in a row, nor by an escape sequence at the start of a token.
+
+ * BUG FIX: "/PROTECT data" directives are now being written when they should
+ be. Previously, they were dropped completely. Reported by Alexandra
+ Rahlin.
+
+ * BUG FIX: CARRAY indices provided to gd_add() in the entry.scalar_ind member
+ are no longer ignored. Reported by S. J. Benton.
+
+ API Changes:
+
+ * Functions which add fields (gd_add(), gd_add_<type>(), &c.) can now be used
+ to add metafields by using their full "parent/name" field code. The old,
+ explicit metafield adding routines (gd_madd(), &c.) are still available.
+
+ * As with their corresponding names in the Standards, the gd_type_t symbols
+ GD_FLOAT and GD_DOUBLE are now deprecated. Use GD_FLOAT32 and GD_FLOAT64 as
+ appropriate.
+
+ * A new open flag, GD_TRUNCSUB, will cause GD_TRUNC to descend into
+ subdirectories of a directory it is truncating. If not specified along with
+ GD_TRUNC, it does nothing.
+
+ * New public functions gd_nentries() and gd_entry_list() provide a generic
+ interface to the field counting and list functionality. The other functions
+ (gd_nfields(), gd_nfields_by_type(), &c. and gd_field_list(),
+ gd_field_list_by_type(), &c. are now simply special cases of these two
+ functions.
+
+ * The "hiddenness" of a field name may be queried with gd_hidden(), set with
+ gd_hide() and cleared with gd_unhide().
+
+ * /INCLUDE affixes may be queried with gd_fragment_affixes() and added,
+ modified or deleted with gd_alter_affixes(). A new fragment can be added to
+ the dirfile with affixes using gd_include_affix().
+
+ * New aliases may be added with gd_add_alias() or gd_madd_alais. The target
+ of an alias is retrned by gd_alias_target(); a list of aliases of a field,
+ or their number, is returned by gd_aliases() and gd_naliases().
+
+ * In addition to the special symbol GD_HERE which may be passed to
+ gd_getdata() and gd_putdata(), the "current location" of fields may be
+ queried with gd_tell() and moved with gd_seek().
+
+ * Because GetData considers aliases and canonical names to be
+ indistinguishable, passing an alias name to most functions will result in
+ the function operating on target field. To manipulate aliases themselves,
+ the API has the new interfaces gd_move_alias(), gd_delete_alias(), and
+ gd_rename_alias().
+
+ * The typedefs gd_bit_t and gd_spf_t have been deprecated. They are replaced
+ with 'int' and 'unsigned int' respectively. For backwards compatibility,
+ the typedefs (with their new types) are still declared in getdata.h, but the
+ API no longer makes use of them.
+
+ * GetData's tokeniser has been exposed to the public API via the gd_strtok()
+ function, which works similar to strtok(3), and returns successive tokens of
+ a string given it.
+
+ * A new function gd_error_count() returns the number of GetData errors
+ encountered on a Dirfile since it was last called (or since the Dirfile was
+ opened). This is useful for programs that care whether *something* failed,
+ but don't really care what it was.
+
+ * Reading MPLEX fields can result in inefficiencies due to GetData having to
+ look backwards for the first value of the derived field. A new function,
+ gd_mplex_lookback(), can be used to alter how much lookback is done.
+
+ * The "move_data" flag in gd_rename() has been replaced with a generic "flags"
+ parameter. Two rename flags are defined: GD_REN_DATA, which recovers the
+ old behaviour of move_data, and GD_REN_UBDB which will cause references to
+ the renamed field to be renamed also in derived fields which refer to it.
+ Without GD_REN_UBDB, these definitions are left unchagned.
+
+ * Flags which affect the long-term operation of GetData may be modified after
+ open using gd_flags(). Currently these flags are just GD_VERBOSE and
+ GD_PRETTY_PRTNT.
+
+ * The gd_flush() function, which both syncs and closes RAW files, has been
+ broken up into its two parts with two new functions: gd_sync(), which just
+ syncs and gd_raw_close(), which just closes. gd_flush() still does both.
+
+ * Using the new gd_desync() function will cause GetData to determine whether
+ the Dirfile metadata on disk has changed since the Dirfile was opened.
+
+ * A prefix to the automatic error messages printed by GetData when using the
+ GD_VERBOSE flag may be specified with gd_verbose_prefix().
+
+ * When requesting the exclusive creation of a new dirfile with (O_CREAT |
+ O_EXCL) GetData will now return the new error GD_E_EXISTS if the dirfile
+ already exists. Previously it would return GD_E_CREAT in this situation.
+
+ * The error codes GD_E_BAD_ENDIANNESS and GD_E_BAD_PROTECTION have been
+ combined into a more generic error code: GD_E_ARGUMENT. The old symbols are
+ retained for backwards compatibility.
+
+ * C89 API: Passing NULL to gd_alter_crecip() for cdividend is now treated as
+ if it were passed zero (ie. it indicates no change for cdividend).
+
+ * BUG FIX: calling gd_putdata() with num_frames and num_samples both zero no
+ longer confuses GetData: instead it simply does nothing.
+
+ * BUG FIX: gd_spf() now returns GD_E_DIMENSION when passed a scalar field
+ code, as the documentation says it should. Previously it returned
+ GD_E_BAD_FIELD_TYPE.
+
+ Legacy API Changes:
+
+ * The never-used n_mplex/mplexEntries part of the FormatType now has a use:
+ both MPLEX and WINDOW entries are reported there.
+
+ Bindings Changes:
+
+ * Python: The return_type, num_fields, and num_samples parameters to
+ dirfile.getdata() are now optional. The return_type defautls to
+ pygetdata.FLOAT, and if neither num_fields nor num_samples are given, all
+ frames (ie. the value of dirfile.nframes) are returned.
+
+ * IDL BUG FIX: The missing /IGNORE_REFS and /PRETTY_PRINT are now available in
+ gd_open.
+
|==============================================================================|
New in version 0.7.3:
@@ -346,7 +593,7 @@
* Python: dirfiles are now opened read-only by default.
- * C++ BUG FIX: Entry::Scalar() no longer rejects valid values of index.
+ * C++ BUG FIX: Entry::Scalar() no longer rejects valid values of index.
* IDL BUG FIX: A memory impropriety involving keyword arguments. This bug
manifested by rejecting valid keyword arguments on 64-bit systems, but may
@@ -375,7 +622,7 @@
New in version 0.6.3:
- Bindings
+ Bindings
* A memory leak has been plugged in the Python bindings manifesting in calls
to dirfile.getdata() returning a NumPy array. In previous versions, the
@@ -402,7 +649,7 @@
* A potential segfault relating to error reporting in the legacy API has
been fixed.
-
+
Bindings
* C++ BUG FIX: Several bugs preventing compilation of the C++ test-suite under
@@ -693,7 +940,7 @@
- dirfile_alter_entry, dirfile_alter_<field-type>, dirfile_alter_spec,
dirfile_malter_spec
-
+
* A field may be moved to a different format file fragment using dirfile_move.
* A field may be renamed by using dirfile_rename.
@@ -713,7 +960,7 @@
is really only useful identically duplicate specifications, since there is
no indication of which of the duplicates is honoured. Explicit control can
be obtained by handling this inside a caller supplied callback function.
-
+
Bindings:
* All functions in the Fortran 77 bindings have been completely renamed from
@@ -762,7 +1009,7 @@
|==============================================================================|
New in version 0.4.1:
-
+
Library Changes
* BUG FIX: Adding an ASCII encoded RAW field no longer creates an empty,
@@ -784,7 +1031,7 @@
|==============================================================================|
New in version 0.4.0:
-
+
Dirfile Changes
* GetData now supports Dirfile Standards Version 6. Standards Version 6 adds
@@ -970,7 +1217,7 @@
are new
This affects the legacy API.
-
+
Legacy API Changes
* The legacy API has been marked deprecated.
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/bindings/f77/fgetdata.c 2012-04-04 23:47:18 UTC (rev 696)
@@ -3341,7 +3341,8 @@
if (!gd_error(D) && (*field_num > 0) && (*field_num <= (int)nfields)) {
v = gd_mstrings(D, pa);
- _GDF_FString(value, value_l, gd_error(D) ? "" : v[*field_num - 1]);
+ _GDF_FString((char*)value, value_l,
+ gd_error(D) ? "" : ((char**)v)[*field_num - 1]);
} else
*value_l = 0;
@@ -3436,11 +3437,11 @@
*field_code_l, in_field, *in_field_l, check_field, *check_field_l,
*windop, threshold, *fragment_index);
- t = _GDF_SetTriplet(*windop, threshold);
+ t = _GDF_SetTriplet((gd_windop_t)*windop, threshold);
gd_add_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), _GDF_CString(&in, in_field, *in_field_l),
- _GDF_CString(&cf, check_field, *check_field_l), *windop, t,
+ _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t,
*fragment_index);
free(fc);
@@ -3464,12 +3465,12 @@
*parent_l, field_code, *field_code_l, in_field, *in_field_l, check_field,
*check_field_l, *windop, threshold);
- t = _GDF_SetTriplet(*windop, threshold);
+ t = _GDF_SetTriplet((gd_windop_t)*windop, threshold);
gd_madd_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&pa, parent,
*parent_l), _GDF_CString(&fc, field_code, *field_code_l),
_GDF_CString(&in, in_field, *in_field_l), _GDF_CString(&cf, check_field,
- *check_field_l), *windop, t);
+ *check_field_l), (gd_windop_t)*windop, t);
free(pa);
free(fc);
@@ -3654,11 +3655,11 @@
*field_code_l, in_field, *in_field_l, check_field, *check_field_l,
*windop, threshold);
- t = _GDF_SetTriplet(*windop, threshold);
+ t = _GDF_SetTriplet((gd_windop_t)*windop, threshold);
gd_alter_window(_GDF_GetDirfile(*dirfile), _GDF_CString(&fc, field_code,
*field_code_l), _GDF_CString(&in, in_field, *in_field_l),
- _GDF_CString(&cf, check_field, *check_field_l), *windop, t);
+ _GDF_CString(&cf, check_field, *check_field_l), (gd_windop_t)*windop, t);
free(cf);
free(in);
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/man/Makefile.am 2012-04-04 23:47:18 UTC (rev 696)
@@ -40,9 +40,9 @@
gd_fragment_index.3 gd_fragmentname.3 gd_framenum_subset.3 \
gd_frameoffset.3 gd_free_entry_strings.3 gd_get_carray_slice.3 \
gd_get_constant.3 gd_get_string.3 gd_getdata.3 gd_hidden.3 \
- gd_hide.3 gd_include.3 gd_invalid_dirfile.3 gd_madd_bit.3 \
- gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 gd_move.3 \
- gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \
+ gd_hide.3 gd_include_affix.3 gd_invalid_dirfile.3 \
+ gd_madd_bit.3 gd_mcarrays.3 gd_mconstants.3 gd_metaflush.3 \
+ gd_move.3 gd_mplex_lookback.3 gd_mstrings.3 gd_naliases.3 \
gd_native_type.3 gd_nentries.3 gd_nfragments.3 gd_nframes.3 \
gd_parent_fragment.3 gd_parser_callback.3 gd_protection.3 \
gd_put_carray_slice.3 gd_put_constant.3 gd_put_string.3 \
@@ -74,6 +74,7 @@
gd_add_spec.3:gd_madd_spec.3 \
gd_cbopen.3:gd_open.3 \
gd_close.3:gd_discard.3 \
+ gd_include_affix.3:gd_include.3 \
gd_alter_bit.3:gd_alter_carray.3 gd_alter_bit.3:gd_alter_clincom.3 \
gd_alter_bit.3:gd_alter_const.3 gd_alter_bit.3:gd_alter_cpolynom.3 \
gd_alter_bit.3:gd_alter_crecip.3 gd_alter_bit.3:gd_alter_divide.3 \
@@ -87,6 +88,8 @@
gd_get_carray_slice.3:gd_get_carray.3 \
gd_put_carray_slice.3:gd_put_carray.3 \
gd_delete.3:gd_delete_alias.3 \
+ gd_rename.3:gd_rename_alias.3 \
+ gd_move.3:gd_move_alias.3 \
gd_hide.3:gd_unhide.3 \
gd_add_alias.3:gd_madd_alias.3 \
gd_flush.3:gd_sync.3 gd_flush.3:gd_raw_close.3 \
Modified: trunk/getdata/man/dirfile-format.5
===================================================================
--- trunk/getdata/man/dirfile-format.5 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/man/dirfile-format.5 2012-04-04 23:47:18 UTC (rev 696)
@@ -526,9 +526,16 @@
The /VERSION directive has
.IR "immediate scope" :
its effect is immediate, and it applies only to metadata below it, including
-and propagating downwards to sub-fragments after the directive. Its effect
-also propagates upwards back to the parent fragment, and affect subsequent
-metadata. It appeared in Standards Version 5.
+and propagating downwards to sub-fragments after the directive.
+.PP
+In Standards Version 8 and earlier, its effect also propagates upwards back to
+the parent fragment, and affect subsequent metadata. Starting with Standards
+Version 9, this no longer happens. As a result, a /VERSION directive which
+indicates a version of 9 or later never propagates upwards; additionally,
+/VERSION directives found in subfragments included in a Version 9 or later
+fragment aren't propagated upwards into that fragment, regardless of the
+Version of the subfragments. The /VERSION directive appeared in Standards
+Version 5.
.RE
.SH FIELD SPECIFICATION LINES
Modified: trunk/getdata/man/gd_delete.3
===================================================================
--- trunk/getdata/man/gd_delete.3 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/man/gd_delete.3 2012-04-04 23:47:18 UTC (rev 696)
@@ -22,7 +22,7 @@
.nh
.ad l
.BI "int gd_delete(DIRFILE *" dirfile ", const char *" field_code ,
-.BI "int " flags );
+.BI "unsigned int " flags );
.HP
.BI "int gd_delete_alias(DIRFILE *" dirfile ", const char *" alias_name ,
.BI "unsigned int " flags );
Deleted: trunk/getdata/man/gd_include.3
===================================================================
--- trunk/getdata/man/gd_include.3 2012-04-04 02:32:43 UTC (rev 695)
+++ trunk/getdata/man/gd_include.3 2012-04-04 23:47:18 UTC (rev 696)
@@ -1,299 +0,0 @@
-.\" gd_include.3. The gd_include man page.
-.\"
-.\" Copyright (C) 2008, 2009, 2010, 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_include 3 "17 August 2011" "Version 0.8.0" "GETDATA"
-.SH NAME
-gd_include \(em add a format specification fragment to a dirfile
-.SH SYNOPSIS
-.B #include <getdata.h>
-.HP
-.nh
-.ad l
-.BI "int gd_include(DIRFILE *" dirfile ", const char *" include_file ,
-.BI "int " parent_fragment ", unsigned long " flags );
-.hy
-.ad n
-.SH DESCRIPTION
-The
-.BR gd_include ()
-adds the format specification fragment given by the path
-.I include_file
-to the specified dirfile, possibly creating the fragment. This occurs as if,
-in the existing fragment indexed
-by
-.IR parent_fragment ,
-the following directive were present:
-.IP
-.BI "/INCLUDE " <include_file>
-.PP
-(see
-.BR dirfile-format (5)).
-If a parser callback function had been specified when the dirfile was opened
-using
-.BR gd_cbopen (3),
-or added later with
-.BR gd_parser_callback (3),
-this callback function will be called if a syntax error is encountered while
-parsing the included fragment.
-
-The
-.I flags
-argument should be a bitwise-or'd collection of the following flags, or zero
-if no flags are desired:
-.TP
-.B GD_BIG_ENDIAN
-Specifies that raw data on disk is stored as big-endian data (most significant
-byte first). Specifying this flag along with the contradictory
-.BR GD_LITTLE_ENDIAN
-will cause the library to assume that the endianness of the data is opposite to
-that of the native architecture.
-
-This flag is ignored completely if an
-.B ENDIAN
-directive occurs in the fragment, unless
-.B GD_FORCE_ENDIAN
-is also specified.
-.TP
-.B GD_CREAT
-An empty fragment will be created, if one does not already exist. The fragment
-will have mode
-.BR S_IRUSR " | " S_IWUSR " | " S_IRGRP " | " S_IWGRP " | " S_IROTH " | " S_IWOTH
-(0666), modified by the caller's umask value (see
-.BR umask (2)).
-.TP
-.B GD_EXCL
-Ensure that this call creates a new fragment: when specified along with
-.BR GD_CREAT ,
-the call will fail if the file specified by
-.I include_file
-already exists. Behaviour of this flag is undefined if
-.B GD_CREAT
-is not specified. This flag suffers from all the limitations of the
-.B O_EXCL
-flag as indicated in
-.BR open (2).
-.TP
-.B GD_FORCE_ENCODING
-Specifies that
-.B ENCODING
-directives (see
-.BR dirfile-format (5))
-found in the fragment should be ignored. The encoding scheme
-specified in
-.I flags
-will be used instead (see below).
-.TP
-.B GD_FORCE_ENDIAN
-Specifies that
-.B ENDIAN
-directives (see
-.BR dirfile-format (5))
-found in the fragment should be ignored. When specified with one of
-.BR GD_BIG_ENDIAN " or " GD_LITTLE_ENDIAN ,
-the indicated endianness will be assumed. If this flag is specified with
-neither of those flags, the fragment will be assumed to have the endianness of
-the native architecture.
-.TP
-.B GD_IGNORE_DUPS
-If the fragment specifies more than one field with the same name, or a field
-with the same name as an existing field, all but one of them will be ignored by
-the parser. Without this flag, parsing would fail with the
-.B GD_E_FORMAT
-error, possibly resulting in invocation of the registered callback function.
-Which of the duplicate fields is kept is not specified, nor whether an existing
-field takes precedence over a new one or not. As a result, this flag is
-typically only useful in the case where identical copies of a field
-specification line are present.
-
-No indication is provided to indicate whether a duplicate field has been
-discarded. If finer grained control is required, the caller should handle
-.B GD_E_FORMAT_DUPLICATE
-suberrors itself with an appropriate callback function.
-.TP
-.B GD_IGNORE_REFS
-If the dirfile currently has a reference field (either because one was specified
-explicitly, or else because the first
-.B RAW
-field was used),
-.B /REFERENCE
-directives in the included fragment will be ignored. Otherwise, a
-.B /REFERENCE
-directive in the included fragment will replace the current reference field in
-the dirfile.
-.TP
-.B GD_LITTLE_ENDIAN
-Specifies that raw data on disk is stored as little-endian data (least
-significant byte first). Specifying this flag along with the contradictory
-.BR GD_BIG_ENDIAN
-will cause the library to assume that the endianness of the data is opposite to
-that of the native architecture.
-
-This flag is ignored completely if an
-.B ENDIAN
-directive occurs in the fragment, unless
-.B GD_FORCE_ENDIAN
-is also specified.
-.TP
-.B GD_PEDANTIC
-Specifies that unrecognised lines found during the parsing of the fragment
-should always cause a fatal error. Without this flag, if a
-.B VERSION
-directive (see
-.BR dirfile-format (5))
-indicates that the fragment being opened conforms Standards Version newer than
-the version understood by the library, unrecognised lines will be silently
-ignored.
-.TP
-.B GD_TRUNC
-If
-.I include_file
-already exists, it will be truncated before opening. If the file does not
-exist, this flag is ignored.
-
-.PP
-The
-.I flags
-argument may also be bitwise or'd with one of the following symbols indicating
-the default encoding scheme of the fragment. Like the endianness flags, the
-choice of encoding here is ignored if the encoding is specified in the fragment
-itself, unless
-.B GD_FORCE_ENCODED
-is also specified. If none of these symbols is present,
-.B GD_AUTO_ENCODED
-is assumed, unless the
-.BR gd_include ()
-call results in creation or truncation of the fragment. In that case,
-.B GD_UNENCODED
-is assumed. See
-.BR dirfile-encoding (5)
-for details on dirfile encoding schemes.
-.TP
-.B GD_AUTO_ENCODED
-Specifies that the encoding type is not known in advance, but should be detected
-by the GetData library. Detection is accomplished by searching for raw data
-files with extensions appropriate to the encoding scheme. This method will
-notably fail if the the library is called via
-.BR putdata (3)
-to create a previously non-existent raw field unless a read is first
-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_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_ENCODED
-Specifies that raw d...
[truncated message content] |
|
From: <ket...@us...> - 2012-04-13 18:25:52
|
Revision: 699
http://getdata.svn.sourceforge.net/getdata/?rev=699&view=rev
Author: ketiltrout
Date: 2012-04-13 18:25:43 +0000 (Fri, 13 Apr 2012)
Log Message:
-----------
Bug fixes. Doc updates.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/TODO
trunk/getdata/bindings/cxx/getdata/fragment.h
trunk/getdata/bindings/cxx/getdata/mplexentry.h
trunk/getdata/bindings/f77/fgetdata.c
trunk/getdata/bindings/f77/getdata.f.in
trunk/getdata/bindings/f77/getdata.f90.in
trunk/getdata/bindings/f77/test/big_test.f
trunk/getdata/bindings/f77/test/big_test95.f90
trunk/getdata/bindings/idl/getdata.c
trunk/getdata/bindings/idl/test/big_test.pro
trunk/getdata/bindings/make_parameters.c
trunk/getdata/doc/README.cxx
trunk/getdata/doc/README.f77
trunk/getdata/doc/README.f95
trunk/getdata/doc/README.idl
trunk/getdata/doc/README.python
trunk/getdata/src/common.c
trunk/getdata/test/Makefile.am
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/ChangeLog 2012-04-13 18:25:43 UTC (rev 699)
@@ -1,3 +1,19 @@
+2012-04-13 D. V. Wiebe <ge...@ke...> svn:699
+ * src/common.c (_GD_CanonicalPath): Terminate and don't clobber string
+ from realpath().
+
+ * bindings/make_parameters.c: Add GD_SIE_ENCODED.
+
+ * bindings/cxx/getdata/fragment.h: Update encodings.
+
+ * bindings/f77/fgetdata.c (GDTOKE) bindings/f77/getdata.f90.in (fgd_strtok):
+ Drop the 'n' parameter: just do what the C API does.
+
+ * bindings/idl/getdata.c (gdidl_getdata gdidl_putdata): Drop /HERE: just use
+ the absense of FIRST_FRAME and FIRST_SAMPLE.
+
+ * bindings/idl/getdata.c (gdidl_add_mplex): Make the MAX parameter optional.
+
2012-04-01 D. V. Wiebe <ge...@ke...> svn:696
* src/compat.c (_GD_ReadDir): Renamed from gd_readdir().
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/NEWS 2012-04-13 18:25:43 UTC (rev 699)
@@ -194,8 +194,9 @@
but don't really care what it was.
* Reading MPLEX fields can result in inefficiencies due to GetData having to
- look backwards for the first value of the derived field. A new function,
- gd_mplex_lookback(), can be used to alter how much lookback is done.
+ look backwards for the first value of the part of the derived field
+ requested. A new function, gd_mplex_lookback(), can be used to alter how
+ much lookback is done, if any.
* The "move_data" flag in gd_rename() has been replaced with a generic "flags"
parameter. Two rename flags are defined: GD_REN_DATA, which recovers the
@@ -242,11 +243,58 @@
Bindings Changes:
+ * F77: Due to small namespace issues, the encoding parameters (corresponding
+ to the GD_...ENCODED symbols in the C API) have all been renamed. They
+ are now of the form GDE_xx.
+
* Python: The return_type, num_fields, and num_samples parameters to
dirfile.getdata() are now optional. The return_type defautls to
pygetdata.FLOAT, and if neither num_fields nor num_samples are given, all
frames (ie. the value of dirfile.nframes) are returned.
+ * IDL: A number of undocumented, unnecessary function aliases have been
+ removed. They should be replaced with their canonical names, without change
+ in use:
+
+ Alias Replacement
+ ---------------------- ----------------
+ GD_ADD_CLINCOM GD_ADD_LINCOM
+ GD_ADD_CPOLYNOM GD_ADD_POLYNOM
+ GD_ADD_CRECIP GD_ADD_RECIP
+ GD_ALTER_CLINCOM GD_ALTER_LINCOM
+ GD_ALTER_CPOLYNOM GD_ALTER_POLYNOM
+ GD_ALTER_CRECIP GD_ALTER_RECIP
+ GD_FIELD_LIST_BY_TYPE GD_ENTRY_LIST
+ GD_FRAMENUM_SUBSET GD_FRAMENUM
+ GD_MADD GD_ADD
+ GD_MADD_BIT GD_ADD_BIT
+ GD_MADD_CARRAY GD_ADD_CARRAY
+ GD_MADD_CLINCOM GD_ADD_LINCOM
+ GD_MADD_CPOLYNOM GD_ADD_POLYNOM
+ GD_MADD_CRECIP GD_ADD_RECIP
+ GD_MADD_DIVIDE GD_ADD_DIVIDE
+ GD_MADD_LINCOM GD_ADD_LINCOM
+ GD_MADD_LINTERP GD_ADD_LINTERP
+ GD_MADD_MULTIPLY GD_ADD_MULTIPLY
+ GD_MADD_PHASE GD_ADD_PHASE
+ GD_MADD_POLYNOM GD_ADD_POLYNOM
+ GD_MADD_RECIP GD_ADD_RECIP
+ GD_MADD_SBIT GD_ADD_SBIT
+ GD_MADD_STRING GD_ADD_STRING
+ GD_MALTER_SPEC GD_ALTER_SPEC
+ GD_MCONSTANTS GD_CONSTANTS
+ GD_MFIELD_LIST GD_ENTRY_LIST
+ GD_MFIELD_LIST_BY_TYPE GD_ENTRY_LIST
+ GD_MSTRINGS GD_STRINGS
+ GD_MVECTOR_LIST GD_VECTOR_LIST
+ GD_NFIELDS_BY_TYPE GD_NENTRIES
+ GD_NMFIELDS GD_NENTRIES
+ GD_NMFIELDS_BY_TYPE GD_NENTRIES
+ GD_NMVECTORS GD_NVECTORS
+
+ * BUG FIX: All bindings now provide a named constant corresponding to the C
+ API error GD_E_UNKNOWN_ENCODING, which was overlooked in previous releases.
+
* IDL BUG FIX: The missing /IGNORE_REFS and /PRETTY_PRINT are now available in
gd_open.
Modified: trunk/getdata/TODO
===================================================================
--- trunk/getdata/TODO 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/TODO 2012-04-13 18:25:43 UTC (rev 699)
@@ -2,3 +2,4 @@
* Hashed compressed files
* linterp table path munging [MH]
* Make webpage suck less
+* Fused multiply-add [CBN]
Modified: trunk/getdata/bindings/cxx/getdata/fragment.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/fragment.h 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/cxx/getdata/fragment.h 2012-04-13 18:25:43 UTC (rev 699)
@@ -45,7 +45,8 @@
AutoEncoding = GD_AUTO_ENCODED, RawEncoding = GD_UNENCODED,
TextEncoding = GD_TEXT_ENCODED, SlimEncoding = GD_SLIM_ENCODED,
GzipEncoding = GD_GZIP_ENCODED, Bzip2Encoding = GD_BZIP2_ENCODED,
- UnsupportedEncoding = GD_ENC_UNSUPPORTED
+ SieEncoding = GD_SIE_ENCODED, ZzipEncoding = GD_ZZIP_ENCODED,
+ ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED
};
class Dirfile;
Modified: trunk/getdata/bindings/cxx/getdata/mplexentry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/mplexentry.h 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/cxx/getdata/mplexentry.h 2012-04-13 18:25:43 UTC (rev 699)
@@ -52,9 +52,9 @@
int SetInput(const char* field, int index);
virtual int SetCountVal(int count_val);
- virtual int SetCountVal(const char* threshold);
+ virtual int SetCountVal(const char* count_val);
virtual int SetCountMax(int count_max);
- virtual int SetCountMax(const char* threshold);
+ virtual int SetCountMax(const char* count_max);
private:
MplexEntry(const GetData::Dirfile *dirfile, const char* field_code) :
Modified: trunk/getdata/bindings/f77/fgetdata.c
===================================================================
--- trunk/getdata/bindings/f77/fgetdata.c 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/f77/fgetdata.c 2012-04-13 18:25:43 UTC (rev 699)
@@ -3862,26 +3862,20 @@
dreturnvoid();
}
-/* gd_tokenise wrapper */
+/* gd_strtok wrapper */
void F77_FUNC(gdtoke, GDTOKE) (char *toke, int32_t *toke_l,
- const int32_t *dirfile, const char *string, const int32_t *string_l,
- const int32_t *n)
+ const int32_t *dirfile, const char *string, const int32_t *string_l)
{
- char *token, *st;
+ char *token, *st = NULL;
DIRFILE *D;
- int i;
- dtrace("%p, %p, %i, %p, %i, %i", toke, toke_l, *dirfile, string, *string_l,
- *n);
+ dtrace("%p, %p, %i, %p, %i", toke, toke_l, *dirfile, string, *string_l);
D = _GDF_GetDirfile(*dirfile);
- _GDF_CString(&st, string, *string_l);
+ if (*string_l > 0)
+ _GDF_CString(&st, string, *string_l);
token = gd_strtok(D, st);
- for (i = 1; i < *n; ++i) {
- free(token);
- token = gd_strtok(D, NULL);
- }
free(st);
_GDF_FString(toke, toke_l, token);
Modified: trunk/getdata/bindings/f77/getdata.f.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f.in 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/f77/getdata.f.in 2012-04-13 18:25:43 UTC (rev 699)
@@ -362,6 +362,8 @@
EXTERNAL GDSYNC
C Corresponding to gd_tell(3)
EXTERNAL GDTELL
+C Corresponding to gd_strtok(3)
+ EXTERNAL GDTOKE
C Corresponding to gd_unhide(3)
EXTERNAL GDUHID
C Corresponding to gd_uninclude(3)
Modified: trunk/getdata/bindings/f77/getdata.f90.in
===================================================================
--- trunk/getdata/bindings/f77/getdata.f90.in 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/f77/getdata.f90.in 2012-04-13 18:25:43 UTC (rev 699)
@@ -2780,13 +2780,13 @@
count_max)
end subroutine
-subroutine fgd_strtok (token, l, dirfile, string, n)
+subroutine fgd_strtok (token, l, dirfile, string)
character (len=*), intent(out) :: token
integer, intent(inout) :: l
- integer, intent(in) :: dirfile, n
+ integer, intent(in) :: dirfile
character (len=*), intent(in) :: string
- call gdtoke(token, l, dirfile, TRIM(string), LEN_TRIM(string), n)
+ call gdtoke(token, l, dirfile, TRIM(string), LEN_TRIM(string))
end subroutine
function fgd_desync (dirfile, flags)
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/f77/test/big_test.f 2012-04-13 18:25:43 UTC (rev 699)
@@ -2059,13 +2059,13 @@
C 232: GDTOKE check
l = slen
- CALL GDTOKE(str, l, d, '"test1 test2" test3\ test4 test5', 32, 1)
+ CALL GDTOKE(str, l, d, '"test1 test2" test3\ test4 test5', 32)
CALL CHKOK2(ne, 232, 1, d)
CALL CHKIN2(ne, 232, 2, l, slen)
CALL CHKST2(ne, 232, 3, str, 'test1 test2')
l = slen
- CALL GDTOKE(str, l, d, '"test1 test2" test3\ test4 test5', 32, 2)
+ CALL GDTOKE(str, l, d, '', -1)
CALL CHKOK2(ne, 232, 4, d)
CALL CHKIN2(ne, 232, 5, l, slen)
CALL CHKST2(ne, 232, 6, str, 'test3 test4')
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2012-04-13 18:25:43 UTC (rev 699)
@@ -2493,13 +2493,13 @@
! 232: fgd_strtok check
l = slen
- call fgd_strtok(str, l, d, '"test1 test2" test3\ test4 test5', 1)
+ call fgd_strtok(str, l, d, '"test1 test2" test3\ test4 test5')
call check_ok2(ne, 232, 1, d)
call check_int2(ne, 232, 2, l, slen)
call check_str2(ne, 232, 3, str, 'test1 test2')
l = slen
- call fgd_strtok(str, l, d, '"test1 test2" test3\ test4 test5', 2)
+ call fgd_strtok(str, l, d, '')
call check_ok2(ne, 232, 4, d)
call check_int2(ne, 232, 5, l, slen)
call check_str2(ne, 232, 6, str, 'test3 test4')
Modified: trunk/getdata/bindings/idl/getdata.c
===================================================================
--- trunk/getdata/bindings/idl/getdata.c 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/idl/getdata.c 2012-04-13 18:25:43 UTC (rev 699)
@@ -1053,10 +1053,12 @@
encoding = GD_SLIM_ENCODED;
else if (strcasecmp(enc, "SIE"))
encoding = GD_SIE_ENCODED;
+ else if (strcasecmp(enc, "TEXT"))
+ encoding = GD_TEXT_ENCODED;
else if (strcasecmp(enc, "ZZIP"))
encoding = GD_ZZIP_ENCODED;
- else if (strcasecmp(enc, "TEXT"))
- encoding = GD_TEXT_ENCODED;
+ else if (strcasecmp(enc, "ZZSLIM"))
+ encoding = GD_ZZSLIM_ENCODED;
else if (strcasecmp(enc, "NONE"))
encoding = GD_UNENCODED;
else if (strcasecmp(enc, "RAW"))
@@ -3559,23 +3561,25 @@
IDL_LONG64 first_sample;
IDL_LONG n_frames;
IDL_LONG n_samples;
- int here;
+ int first_frame_x, first_sample_x;
gd_type_t return_type;
} KW_RESULT;
KW_RESULT kw;
IDL_VPTR r;
- kw.first_frame = kw.first_sample = kw.n_frames = kw.n_samples = kw.here = 0;
+ kw.first_frame = kw.first_sample = kw.n_frames = kw.n_samples = 0;
+ kw.first_frame_x = kw.first_sample_x = 0;
kw.return_type = GD_FLOAT64;
GDIDL_KW_INIT_ERROR;
static IDL_KW_PAR kw_pars[] = {
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
- { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(first_frame) },
- { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(first_sample) },
- { "HERE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(here) },
+ { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_frame_x),
+ IDL_KW_OFFSETOF(first_frame) },
+ { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x),
+ IDL_KW_OFFSETOF(first_sample) },
{ "NUM_FRAMES", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(n_frames) },
{ "NUM_SAMPLES", IDL_TYP_LONG, 1, 0, 0, IDL_KW_OFFSETOF(n_samples) },
{ "TYPE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(return_type) },
@@ -3591,7 +3595,7 @@
DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
const char* field_code = IDL_VarGetString(argv[1]);
- if (kw.here) {
+ if (kw.first_frame_x == 0 && kw.first_sample_x == 0) {
kw.first_frame = GD_HERE;
kw.first_sample = 0;
}
@@ -4675,19 +4679,20 @@
GDIDL_KW_RESULT_ERROR;
IDL_LONG64 first_frame;
IDL_LONG64 first_sample;
- int here;
+ int first_frame_x, first_sample_x;
} KW_RESULT;
KW_RESULT kw;
- kw.first_frame = kw.first_sample = kw.here = 0;
+ kw.first_frame = kw.first_sample = kw.first_frame_x = kw.first_sample_x = 0;
GDIDL_KW_INIT_ERROR;
static IDL_KW_PAR kw_pars[] = {
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
- { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(first_frame) },
- { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, 0, IDL_KW_OFFSETOF(first_sample) },
- { "HERE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(here) },
+ { "FIRST_FRAME", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x),
+ IDL_KW_OFFSETOF(first_frame) },
+ { "FIRST_SAMPLE", IDL_TYP_LONG64, 1, 0, IDL_KW_OFFSETOF(first_sample_x),
+ IDL_KW_OFFSETOF(first_sample) },
{ NULL }
};
@@ -4696,7 +4701,7 @@
DIRFILE *D = gdidl_get_dirfile(IDL_LongScalar(argv[0]));
const char* field_code = IDL_VarGetString(argv[1]);
- if (kw.here) {
+ if (kw.first_frame_x == 0 && kw.first_sample_x == 0) {
kw.first_frame = GD_HERE;
kw.first_sample = 0;
}
@@ -5102,7 +5107,7 @@
dreturnvoid();
}
-/* @@DLM: P gdidl_add_mplex GD_ADD_MPLEX 6 6 KEYWORDS */
+/* @@DLM: P gdidl_add_mplex GD_ADD_MPLEX 5 5 KEYWORDS */
void gdidl_add_mplex(int argc, IDL_VPTR argv[], char *argk)
{
dtraceidl();
@@ -5113,16 +5118,18 @@
IDL_STRING parent;
int parent_x;
int fragment_index;
+ int max;
} KW_RESULT;
KW_RESULT kw;
GDIDL_KW_INIT_ERROR;
- kw.fragment_index = kw.parent_x = 0;
+ kw.fragment_index = kw.parent_x = kw.max = 0;
static IDL_KW_PAR kw_pars[] = {
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
{ "FRAGMENT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(fragment_index) },
+ { "MAX", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(max) },
{ "PARENT", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(parent_x),
IDL_KW_OFFSETOF(parent) },
{ NULL }
@@ -5135,13 +5142,13 @@
const char* in_field = IDL_VarGetString(argv[2]);
const char* count = IDL_VarGetString(argv[3]);
int val = IDL_LongScalar(argv[4]);
- int max = IDL_LongScalar(argv[5]);
if (kw.parent_x) {
const char* parent = IDL_STRING_STR(&kw.parent);
- gd_madd_mplex(D, parent, field_code, in_field, count, val, max);
+ gd_madd_mplex(D, parent, field_code, in_field, count, val, kw.max);
} else
- gd_add_mplex(D, field_code, in_field, count, val, max, kw.fragment_index);
+ gd_add_mplex(D, field_code, in_field, count, val, kw.max,
+ kw.fragment_index);
GDIDL_SET_ERROR(D);
@@ -5180,16 +5187,16 @@
GDIDL_KW_INIT_ERROR;
static IDL_KW_PAR kw_pars[] = {
+ { "CHECK_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(check_x),
+ IDL_KW_OFFSETOF(check) },
{ "CLR", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(clr) },
{ "EQ", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(eq) },
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
{ "GE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ge) },
{ "GT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(gt) },
- { "IN_FIELD1", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
+ { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field_x),
IDL_KW_OFFSETOF(in_field) },
- { "IN_FIELD2", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(check_x),
- IDL_KW_OFFSETOF(check) },
{ "LE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(le) },
{ "LT", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(lt) },
{ "NE", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(ne) },
@@ -5316,14 +5323,14 @@
GDIDL_KW_INIT_ERROR;
static IDL_KW_PAR kw_pars[] = {
+ { "COUNT_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x),
+ IDL_KW_OFFSETOF(in_field2) },
{ "COUNT_MAX", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(max) },
{ "COUNT_VAL", IDL_TYP_INT, 1, 0, 0, IDL_KW_OFFSETOF(val) },
GDIDL_KW_PAR_ERROR,
GDIDL_KW_PAR_ESTRING,
- { "IN_FIELD1", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x),
+ { "IN_FIELD", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field1_x),
IDL_KW_OFFSETOF(in_field1) },
- { "IN_FIELD2", IDL_TYP_STRING, 1, 0, IDL_KW_OFFSETOF(in_field2_x),
- IDL_KW_OFFSETOF(in_field2) },
{ NULL }
};
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2012-04-13 18:25:43 UTC (rev 699)
@@ -1136,7 +1136,7 @@
; 203: gd_seek
n = gd_seek(d, "data", frame_num=35)
nume += check_ok2(203, 0, d)
-m = gd_getdata(d, "data", type=!GD.INT16, /here, num_frames=1)
+m = gd_getdata(d, "data", type=!GD.INT16, num_frames=1)
nume += check_ok2(203, 1, d)
nume += check_simple2(203, 0, n, 280)
nume += check_simple2(203, 1, m, INDGEN(8) + 17)
@@ -1298,7 +1298,7 @@
nume += check_simple2(228, 5, n.count_max, 10)
; 229: gd_add_mplex check
-gd_add_mplex, d, 'new21', 'in1', 'in2', 5, 6
+gd_add_mplex, d, 'new21', 'in1', 'in2', 5, max=6
nume += check_ok2(229, 1, d)
n = gd_entry(d, 'new21')
@@ -1310,7 +1310,7 @@
nume += check_simple2(229, 5, n.count_max, 6)
; 230: gd_madd_mplex check
-gd_add_mplex, d, parent='data', 'mnew21', 'in2', 'in3', 0, 12
+gd_add_mplex, d, parent='data', 'mnew21', 'in2', 'in3', 0, max=12
nume += check_ok2(230, 1, d)
n = gd_entry(d, 'data/mnew21')
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/bindings/make_parameters.c 2012-04-13 18:25:43 UTC (rev 699)
@@ -119,13 +119,14 @@
CONSTANT(AUTO_ENCODED, "GDE_AU", 1),
CONSTANT(BZIP2_ENCODED, "GDE_BZ", 2),
+ CONSTANT(GZIP_ENCODED, "GDE_GZ", 2),
CONSTANT(LZMA_ENCODED, "GDE_LZ", 2),
+ CONSTANT(SIE_ENCODED, "GDE_SI", 2),
+ CONSTANT(SLIM_ENCODED, "GDE_SL", 2),
+ CONSTANT(TEXT_ENCODED, "GDE_TX", 2),
CONSTANT(UNENCODED, "GDE_UN", 2),
- CONSTANT(GZIP_ENCODED, "GDE_GZ", 2),
- CONSTANT(TEXT_ENCODED, "GDE_TX", 2),
- CONSTANT(SLIM_ENCODED, "GDE_SL", 2),
+ CONSTANT(ZZSLIM_ENCODED, "GDE_ZS", 2),
CONSTANT(ZZIP_ENCODED, "GDE_ZZ", 2),
- CONSTANT(ZZSLIM_ENCODED, "GDE_ZS", 2),
CONSTANT(NO_ENTRY, "GD_NOE", 3),
CONSTANT(RAW_ENTRY, "GD_RWE", 3),
Modified: trunk/getdata/doc/README.cxx
===================================================================
--- trunk/getdata/doc/README.cxx 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/doc/README.cxx 2012-04-13 18:25:43 UTC (rev 699)
@@ -51,7 +51,8 @@
IndexEntryType = GD_INDEX_ENTRY,
DivideEntryType = GD_DIVIDE_ENTRY,
RecipEntryType = GD_RECIP_ENTRY,
- WindowEntryType = GD_WINDOW_ENTRY
+ WindowEntryType = GD_WINDOW_ENTRY,
+ MPlexEntryType = GD_MPLEX_ENTRY
};
The GetData window operations (defined in getdata/entry.h):
@@ -73,7 +74,8 @@
AutoEncoding = GD_AUTO_ENCODED, RawEncoding = GD_UNENCODED,
TextEncoding = GD_TEXT_ENCODED, SlimEncoding = GD_SLIM_ENCODED,
GzipEncoding = GD_GZIP_ENCODED, Bzip2Encoding = GD_BZIP2_ENCODED,
- UnsupportedEncoding = GD_ENC_UNSUPPORTED
+ SieEncoding = GD_SIE_ENCODED, ZzipEncoding = GD_ZZIP_ENOCDED,
+ ZzslimEncoding = GD_ZZSLIM_ENCODED, UnsupportedEncoding = GD_ENC_UNSUPPORTED
};
@@ -126,7 +128,7 @@
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)..
+ was last called (or, the first time, since the object was created).
* const char *Dirfile::ErrorString()
* const char *Dirfile::ErrorString(size_t len)
@@ -216,8 +218,11 @@
* const void *Dirfile::Constants(GetData::DataType type = Float64)
* int Dirfile::Delete(const char *field_code, int flags = 0)
* int Dirfile::DeleteAlias(const char* field_code, int flags = 0)
+* const char **Dirfile::EntryList(const char *parent = NULL,
+ unsigned int type = 0, unsigned int flags = 0)
* const char **Dirfile::FieldList()
* const char **Dirfile::FieldListByType(GetData::EntryType type)
+* unsigned long Dirfile::Flags(unsigned long set = 0, unsigned long reset = 0)
* int Dirfile::Flush(const char *field_code = NULL)
* const char *Dirfile::FormatFilename(int index)
* int Dirfile::GetCarray(const char *field_code, GetData::DataType type,
@@ -241,15 +246,18 @@
* int Dirfile::MAlterSpec(const char *line, const char *parent)
* const gd_carray_t *Dirfile::MCarrays(GetData::DataType type = Float64)
* const void *Dirfile::MConstants(const char *parent, GetData::DataType type)
+* int Dirfile::MetaFlush()
* const char **Dirfile::MFieldList(const char *parent)
* const char **Dirfile::MFieldListByType(const char *parent,
- * GetData::EntryType type)
-* int Dirfile::MetaFlush()
+ GetData::EntryType type)
+* int MplexLookback(int lookback)
* int Dirfile::MoveAlias(const char* field_code, int new_fragment)
* const char **Dirfile::MStrings(const char *parent)
* const char **Dirfile::MVectorList(const char *parent)
* int Dirfile::NAliases(const char* field_code)
* DataType Dirfile::NativeType(const char *field_code)
+* unsigned int Dirfile::NEntries(const char *parent = NULL,
+ unsigned int type = 0, unsigned int flags = 0)
* unsigned int Dirfile::NFields()
* unsigned int Dirfile::NFieldsByType(GetData::EntryType type)
* off_t Dirfile::NFrames()
@@ -267,15 +275,18 @@
off_t first_sample, size_t num_frames, size_t num_samples,
GetData::DataType type, const void *data_in)
* size_t Dirfile::PutString(const char *field_code, const char *data_in)
+* int RawClose(const char *field_code = NULL)
* unsigned int Dirfile::SamplesPerFrame(const char *field_code)
* off_t Dirfile::Seek(const char *field_code, off_t frame_num, off_t sample_num,
int whence)
* const char **Dirfile::Strings()
+* char *StrTok(const char *string = NULL)
* int Dirfile::Sync(const char* field_code = NULL)
* off_t Dirfile::Tell(const char *field_code)
* int Dirfile::UnHide(const char* field_code)
* int Dirfile::Validate(const char *field_code)
* const char **Dirfile::VectorList()
+* int VerbosePrefix(const char *prefix = NULL)
These methods call the corresponding function from the C API on the C DIRFILE
object associated with the C++ object. For allowed values for arguments of
@@ -350,13 +361,9 @@
* EntryType Entry::Type()
- This will return the field type of the Entry's field. This will be one of:
+ This will return the field type of the Entry's field. This will be one of the
+ Entry types listed above in the CONSTANTS section.
- NoEntryType, BitEntryType, ConstEntryType, DivideEntryType, IndexEntryType,
- LincomEntryType, LinterpEntryType, MultiplyEntryType, PhaseEntryType,
- PolynomEntryType, RawEntryType, RecipEntryType, SBitEntryType,
- StringEntryType
-
* int Entry::SetFragmentIndex(int fragment_index)
* int Entry::Move(int new_fragment, int move_data = 0)
@@ -390,9 +397,10 @@
* virtual DataType Entry::ConstType()
* virtual size_t Entry::ArrayLen()
* virtual const char *Entry::Table()
-* virtual const char *Entry::Check()
* virtual WindOpType Entry::WindOp()
* virtual gd_triplet_t Entry::Threshold()
+* virtual int Entry::CountVal()
+* virtual int Entry::CountMax()
These methods will return the corresponding member of the gd_entry_t object.
Only methods reasonable to be queried for the given field type will return
@@ -723,8 +731,7 @@
* WindowEntry::WindowEntry(const char *field_code, const char *in_field,
const char *check_field, int fragment_index = 0)
-* virtual const char *WindowEntry::Input()
-* virtual const char *WindowEntry::Check()
+* virtual const char *WindowEntry::Input(int index = 0)
* virtual const char *WindowEntry::Scalar()
* virtual int WindowEntry::ScalarIndex()
* virtual WindOpType WindowEntry::WindOp()
@@ -733,8 +740,7 @@
These methods, re-implemented from the Entry class, return the corresponding
field parameter.
-* int WindowEntry::SetInput(const char *field)
-* int WindowEntry::SetCheck(const char *field)
+* int WindowEntry::SetInput(const char *field, int index)
* int WindowEntry::SetWindOp(WindOpType coeff)
* int WindowEntry::SetThreshold(gd_triplet_t threshold)
* int WindowEntry::SetThreshold(const char *threhsold)
@@ -745,6 +751,38 @@
above.
+MplexEntry Class
+-------------------
+
+Defined in getdata/mplex.h
+
+* Mplex::MplexEntry()
+
+ This creates a new MPLEX entry object with default parameters.
+
+* MplexEntry::MplexEntry(const char *field_code, const char *in_field,
+ const char *check_field, int fragment_index = 0)
+
+* virtual const char *MplexEntry::Input(int index = 0)
+* virtual const char *MplexEntry::Scalar()
+* virtual int MplexEntry::ScalarIndex()
+* virtual int MplexEntry::CountVal()
+* virtual int MplexEntry::CountMax()
+
+ These methods, re-implemented from the Entry class, return the corresponding
+ field parameter.
+
+* int MplexEntry::SetInput(const char *field, int index)
+* int MplexEntry::SetWindOp(WindOpType coeff)
+* int MplexEntry::SetCountVal(int count_val)
+* int MplexEntry::SetCountVal(const char *count_val)
+* int MplexEntry::SetCountMax(int count_max)
+* int MplexEntry::SetCountMax(const char *count_max)
+
+ These functions will change the specified input field, check field, or the
+ count value or max to the value or field code supplied.
+
+
CarraytEntry Class
----------------
Modified: trunk/getdata/doc/README.f77
===================================================================
--- trunk/getdata/doc/README.f77 2012-04-06 16:18:19 UTC (rev 698)
+++ trunk/getdata/doc/README.f77 2012-04-13 18:25:43 UTC (rev 699)
@@ -2,8 +2,8 @@
===============================
This README describes the Fortran 77 bindings for the GetData library. These
-bindings consist of a Fortran compatibility library `libfgetdata' (written in
-C) and a Fortran 77 source file `getdata.f' which defines useful Fortran
+bindings consist of a Fortran compatibility library, 'libfgetdata' (written in
+C) and a Fortran 77 source file, 'getdata.f' which defines useful Fortran
parameters and declares the external subroutines.
These bindings are designed to comply to the Fortran 77 standards. As a result,
@@ -31,7 +31,7 @@
All integer type parameters passed to the compatibility library are of type
INTEGER (i.e. the native size of the platform). As a result, largefile support
-will not be available in the Fortran 77 bindings on a 32-bit system.
+are not be available in the Fortran 77 bindings.
All character string arguments require also an integer indicating the size of
the character buffer. In cases where the bindings return a string value, the
@@ -91,6 +91,26 @@
GDINCA. Use GDCLBK to change the callback function before calling GDINCL or
GDINCA, if required.
+* GDCLBK(dirfile_unit, callback)
+
+ Input:
+ INTEGER dirfile_unit
+ EXTERNAL callback
+
+ This wraps gd_parser_callback(3), setting the registered parser callback to
+ the subroutine given. The signature of this subroutine is given above under
+ GDCOPN. Unlike the C interface, this function cannot be used to remove a
+ registered callback; use GDNOCB for that.
+
+* GDNOCB(dirfile_unit)
+
+ Input:
+ INTEGER dirfile_unit
+
+ This calls gd_parser_callback(3) to deregister a previous parser callback
+ associated with the specified dirfile. If it had none, this procedure does
+ nothing.
+
* GDINVD(dirfile_unit)
Output:
@@ -136,6 +156,16 @@
synced, and field_code will be ignored. Otherwise the field named by
field_code will be synced.
+* GDRCLO(dirfile_unit, field_code, field_code_len)
+
+ Input:
+ INTEGER dirfile_unit, field_code_len
+ CHARACTER*<field_code_len> field_code
+
+ This wraps gd_raw_close(3). If field_code_len is zero, the entire dirfile
+ will be closed, and field_code will be ignored. Otherwise the field named by
+ field_code will be closed.
+
* GDMFLS(dirfile_unit)
Input:
@@ -144,7 +174,52 @@
This subroutine wraps gd_metaflush(3), and will cause metadata changes to be
written to disk.
+* GDDSYN(desync, dirfile_unit, flags)
+ Output:
+ INTEGER desync
+ Input:
+ INTEGER dirfile_unit, flags
+
+ This ...
[truncated message content] |
|
From: <ket...@us...> - 2012-04-18 06:23:38
|
Revision: 701
http://getdata.svn.sourceforge.net/getdata/?rev=701&view=rev
Author: ketiltrout
Date: 2012-04-18 06:23:28 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
Conditionalise sys/wait.h
Modified Paths:
--------------
trunk/getdata/configure.ac
trunk/getdata/test/error_verbose.c
trunk/getdata/test/error_verbose_prefix.c
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-04-13 18:28:12 UTC (rev 700)
+++ trunk/getdata/configure.ac 2012-04-18 06:23:28 UTC (rev 701)
@@ -550,7 +550,7 @@
AC_CHECK_HEADERS([asm/unaligned.h Availability.h byteswap.h direct.h fcntl.h \
inttypes.h io.h libgen.h libkern/OSByteOrder.h stddef.h \
stdint.h sys/endian.h sys/file.h sys/param.h sys/stat.h \
- sys/types.h unistd.h])
+ sys/types.h sys/wait.h unistd.h])
if test "x$disable_c99" = "xno"; then
AC_CHECK_HEADERS([complex.h])
fi
Modified: trunk/getdata/test/error_verbose.c
===================================================================
--- trunk/getdata/test/error_verbose.c 2012-04-13 18:28:12 UTC (rev 700)
+++ trunk/getdata/test/error_verbose.c 2012-04-18 06:23:28 UTC (rev 701)
@@ -21,7 +21,9 @@
#include "test.h"
#include <stdlib.h>
+#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
Modified: trunk/getdata/test/error_verbose_prefix.c
===================================================================
--- trunk/getdata/test/error_verbose_prefix.c 2012-04-13 18:28:12 UTC (rev 700)
+++ trunk/getdata/test/error_verbose_prefix.c 2012-04-18 06:23:28 UTC (rev 701)
@@ -21,7 +21,9 @@
#include "test.h"
#include <stdlib.h>
+#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-04-19 23:36:16
|
Revision: 702
http://getdata.svn.sourceforge.net/getdata/?rev=702&view=rev
Author: ketiltrout
Date: 2012-04-19 23:36:06 +0000 (Thu, 19 Apr 2012)
Log Message:
-----------
* Perl docs + tweaks
* Fix _GD_Add() protect bug.
* Remove GNUisms to permit building on OpenBSD.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/bindings/cxx/test/Makefile.am
trunk/getdata/bindings/f77/Makefile.am
trunk/getdata/bindings/perl/Build.PL.in
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/big_test.t
trunk/getdata/bindings/perl/typemap
trunk/getdata/man/gd_alter_bit.3
trunk/getdata/man/gd_move.3
trunk/getdata/man/gd_rename.3
trunk/getdata/src/add.c
trunk/getdata/test/Makefile.am
trunk/getdata/test/error_verbose.c
trunk/getdata/test/error_verbose_prefix.c
Added Paths:
-----------
trunk/getdata/doc/README.perl
Property Changed:
----------------
trunk/getdata/test/
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-04-18 06:23:28 UTC (rev 701)
+++ trunk/getdata/ChangeLog 2012-04-19 23:36:06 UTC (rev 702)
@@ -1,3 +1,31 @@
+2012-04-19 D. V. Wiebe <ge...@ke...> svn:701
+ * src/add.c (_GD_Add): Don't check protection level before figuring out the
+ fragment index.
+
+ * bindings/perl/GetData.xs bindings/perl/typemap
+ bindings/perl/simple_funcs.pl: gdpu_spf_t -> gdpu_uint_t.
+
+ * bindings/perl/GetData.xs (gdp_to_entry entry): Use "in_fields" everywhere
+ to be consistent with the C API.
+
+ * bindings/perl/GetData.xs (mcarrays): Remove unpacked. Use GIMME_V
+ instead.
+
+ * bindings/perl/simple_funcs.xsin (reference alter_phase add_window
+ alter_window alter_affixes add_mplex alter_mplex desync flags
+ verbose_prefix): Fix parameter defaults and types.
+
+ * bindings/perl/Build.PL.in: Install GetData.pm
+
+ * bindings/perl/simple_funcs.xsin (include include_affex): Deleted.
+ * bindings/perl/GetData.xs (include): Added.
+
+ * doc/README.perl: Added.
+ * bindings/perl/GetData.pm.in: POD.
+
+ * bindings/cxx/test/Makefile.am bindings/f77/Makefile.am test/Makefile.am
+ test/error_verbose.c test/error_verbose_prefix.c: Remove GNUisms.
+
2012-04-13 D. V. Wiebe <ge...@ke...> svn:699
* src/common.c (_GD_CanonicalPath): Terminate and don't clobber string
from realpath().
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2012-04-18 06:23:28 UTC (rev 701)
+++ trunk/getdata/NEWS 2012-04-19 23:36:06 UTC (rev 702)
@@ -100,12 +100,12 @@
* BUG FIX: In previous versions, renaming a field with gd_rename() wouldn't
update or invalidate the cache of fields which depended on the old name,
- leading to surprising results. It will now either invalidate these fields
+ leading to surprising results. It will now either invalidate these fields'
metadata caches or else change the name in those definitions as well.
* BUG FIX: The invalid syntax "/META parent/child granchild ..." is now
- properly rejected by the metadata parser. Previously it half-worked,
- resulting in segfault in gd_close().
+ properly rejected by the parser. Previously it half-worked, resulting in
+ a segfault in gd_close().
* BUG FIX: Several syntax errors encountered in PHASE and RECIP field
specifications weren't being reported by the parser, leading to corrupted
@@ -115,8 +115,8 @@
metadata to disk. Nor does it forget to put newlines after RECIP or DIVIDE
field specifications.
- * BUG FIX: GetData no longer assumes all fields have the same number of
- samples-per-frame when computing a LINCOM.
+ * BUG FIX: GetData no longer assumes all LINCOM input fields have the same
+ number of samples per frame.
* BUG FIX: Writing an empty fragment with GD_PRETTY_PRINT turned on no longer
results in a floating-point exception.
@@ -138,6 +138,12 @@
* BUG FIX: CARRAY indices provided to gd_add() in the entry.scalar_ind member
are no longer ignored. Reported by S. J. Benton.
+ * BUG FIX: When adding a metafield with gd_(m)add(), GetData no longer checks
+ the protection of the fragment indexed by entry->fragment_index. Instead it
+ ignores entry->fragment_index completely (as the documentation indicates it
+ should) and checks the protection of the fragment containing the parent
+ field.
+
API Changes:
* Functions which add fields (gd_add(), gd_add_<type>(), &c.) can now be used
Modified: trunk/getdata/bindings/cxx/test/Makefile.am
===================================================================
--- trunk/getdata/bindings/cxx/test/Makefile.am 2012-04-18 06:23:28 UTC (rev 701)
+++ trunk/getdata/bindings/cxx/test/Makefile.am 2012-04-19 23:36:06 UTC (rev 702)
@@ -41,7 +41,7 @@
$(MAKE) getdata-clean-dirs
getdata-clean-dirs:
- rm -rvf *odirfile
+ rm -rf *odirfile
clean-local:
$(MAKE) getdata-clean-dirs
Modified: trunk/getdata/bindings/f77/Makefile.am
===================================================================
--- trunk/getdata/bindings/f77/Makefile.am 2012-04-18 06:23:28 UTC (rev 701)
+++ trunk/getdata/bindings/f77/Makefile.am 2012-04-19 23:36:06 UTC (rev 702)
@@ -80,8 +80,8 @@
make_parameters.sed: make_parameters.stamp
@if test ! -f $@; then \
- rm -f $<; \
- $(MAKE) $<; \
+ rm -f make_parameters.stamp; \
+ $(MAKE) make_parameters.stamp; \
fi
if HAVE_DIFF
@@ -106,10 +106,10 @@
getdata.f: $(srcdir)/getdata.f.in make_parameters.sed
rm -f $@
- $(SED) -f make_parameters.sed $< > $@
+ $(SED) -f make_parameters.sed $(srcdir)/getdata.f.in > $@
chmod a-w $@
getdata.f90: $(srcdir)/getdata.f90.in make_parameters.sed
rm -f $@
- $(SED) -f make_parameters.sed $< > $@
+ $(SED) -f make_parameters.sed $(srcdir)/getdata.f90.in > $@
chmod a-w $@
Modified: trunk/getdata/bindings/perl/Build.PL.in
===================================================================
--- trunk/getdata/bindings/perl/Build.PL.in 2012-04-18 06:23:28 UTC (rev 701)
+++ trunk/getdata/bindings/perl/Build.PL.in 2012-04-19 23:36:06 UTC (rev 702)
@@ -27,6 +27,7 @@
include_dirs => '@top_srcdir@/src',
license => 'lgpl',
module_name => "GetData",
+ pm_files => { 'GetData.pm' => 'lib/GetData.pm' },
release_status => "testing",
requires => {
perl => '5.6.0',
Modified: trunk/getdata/bindings/perl/GetData.pm.in
===================================================================
--- trunk/getdata/bindings/perl/GetData.pm.in 2012-04-18 06:23:28 UTC (rev 701)
+++ trunk/getdata/bindings/perl/GetData.pm.in 2012-04-19 23:36:06 UTC (rev 702)
@@ -29,10 +29,10 @@
require Math::Complex;
our @ISA = qw(Exporter);
-our %EXPORT_TAGS = ( 'all' => [ qw(VERSION @FUNCLIST@ @PARAMLIST@) ],
-'constants' => [ qw(VERSION @PARAMLIST@) ], 'functions' => [ qw(@FUNCLIST@) ]);
+our %EXPORT_TAGS = ('all' => [qw(VERSION @FUNCLIST@ @PARAMLIST@)],
+'constants' => [qw(VERSION @PARAMLIST@)], 'functions' => [qw(@FUNCLIST@)]);
-our @EXPORT_OK = ( @{$EXPORT_TAGS{'all'}} );
+our @EXPORT_OK = (@{$EXPORT_TAGS{'all'}});
our @EXPORT = qw();
@PARAMETERS@
@@ -54,8 +54,8 @@
# 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);
+ $GetData::UINT8);
+ my $data = $DIRFILE->getdata("field", 5, 0, 1, $GetData::UINT8);
=head1 DESCRIPTION
@@ -65,59 +65,1162 @@
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.
+The dirfile lvalue returned by GetData::open 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.
+but this is discouraged, as it will overwrite useful things like &CORE::open.
-=head1 METHODS
+Throughout the module, complex data are generally represented as
+C<Math::Complex> objects, but may be simplified to ordinary floating point
+numbers if the imaginary part is zero.
+=head1 CONSTANTS
+
+The module defines a large number of symbolic constants used by the API which
+mirror the constants defined in the C API. The "constants" tag may be used to
+export just the constants from the module, if desired. Some genericly useful
+sets of constants are discussed below. Other constants are discussed in the
+method descriptions where they are used.
+
+=head2 Data Types
+
+GetData knows the following data types:
+
=over
-=item cbopen ( DIRFILENAME, FLAGS, SEHANDLER, EXTRA )
+=item $GetData::NULL
-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.
+the null data type, which returns no data.
-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:
+=item $GetData::UINT8
+unsigned 8-bit integer
+
+=item $GetData::INT8
+
+signed (two's complement) 8-bit integer
+
+=item $GetData::UINT16
+
+unsigned 16-bit integer
+
+=item $GetData::INT16
+
+signed (two's complement) 16-bit integer
+
+=item $GetData::UINT32
+
+unsigned 32-bit integer
+
+=item $GetData::INT32
+
+signed (two's complement) 32-bit integer
+
+=item $GetData::UINT64
+
+unsigned 64-bit integer
+
+=item $GetData::INT64
+
+signed (two's complement) 64-bit integer
+
+=item $GetData::FLOAT32
+
+IEEE-754 standard 32-bit single precision floating point number
+
+=item $GetData::FLOAT64
+
+IEEE-754 standard 64-bit double precision floating point number
+
+=item $GetData::COMPLEX64
+
+FORTRAN and C99 conformant 64-bit single precision floating point complex number
+
+=item $GetData::COMPLEX128
+
+FORTRAN and C99 conformant 128-bit double precision floating point complex
+number
+
+=back
+
+=head2 Encoding Types
+
+The following encoding types are known by GetData:
+
=over
-=item * an integer, one of the $GetData::SYNTAX_... constants; or
+$GetData::BZIP2_ENCODED,
+$GetData::GZIP_ENCODED,
+$GetData::LZMA_ENCODED,
+$GetData::SIE_ENCODED,
+$GetData::SLIM_ENCODED,
+$GetData::TEXT_ENCODED,
+$GetData::ZZIP_ENCODED,
+$GetData::ZZSLIM_ENCODED,
+$GetData::UNENCODED.
-=item * a string containing the corrected line, in which case
-$GetData::SYNTAX_RESCAN is assumed; or,
+=back
-=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.
+Details of these encoding types are given in the dirfile-format(5) manual page.
+=head2 Entry Types
+
+The following symbols are used to indicate entry types:
+
+=over
+
+$GetData::NO_ENTRY,
+$GetData::BIT_ENTRY,
+$GetData::CARRAY_ENTRY,
+$GetData::CONST_ENTRY,
+$GetData::DIVIDE_ENTRY,
+$GetData::INDEX_ENTRY,
+$GetData::LINCOM_ENTRY,
+$GetData::LINTERP_ENTRY,
+$GetData::MPLEX_ENTRY,
+$GetData::MULTIPLY_ENTRY,
+$GetData::PHASE_ENTRY,
+$GetData::POLYNOM_ENTRY,
+$GetData::RAW_ENTRY,
+$GetData::RECIP_ENTRY,
+$GetData::SBIT_ENTRY,
+$GetData::STRING_ENTRY,
+$GetData::WINDOW_ENTRY
+
=back
+Of these, C<$GetData::NO_ENTRY> is used to flag invalid entry types and
+C<$GetData::INDEX_ENTRY> is used only for the implicit B<INDEX> field. See
+gd_entry(3) and dirfile-format(5) for details of the other entry types.
+
+=head2 WINDOW Operators
+
+The following symbols are used to indicate WINDOW operators:
+
+=over
+
+$GetData::WINDOP_EQ,
+$GetData::WINDOP_GE,
+$GetData::WINDOP_GT,
+$GetData::WINDOP_LE,
+$GetData::WINDOP_LT,
+$GetData::WINDOP_NE,
+$GetData::WINDOP_CLR,
+$GetData::WINDOP_SET.
+
+=back
+
+=head1 INPUT DATA
+
+Functions which take sets of data as input (L<add_carray>, L<madd_carray>,
+L<put_carray>, L<put_carray_slice>, and L<putdata>) accept data in a number of
+ways. The arguments specifying the data always appear at the end of the
+argument list. They are represented as C<{DATA...}> in the method descriptions
+below. Input data arguments are parsed as follows.
+
+=over
+
+=item 1.
+
+If the first data argument is undef, then it is ignored and all subsequent
+arguments are taken as data:
+
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ undef, @data)
+
+or
+
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ undef, $data[0], $data[1], $data[2], ...)
+
+=item 2.
+
+Otherwise, if the first data argument is a reference to an array, the array is
+taken as data (and any further arguments are ignored):
+
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ \@data)
+
+=item 3.
+
+Otherwise, if only two arguments make up the data argument list, and the second
+is a reference to an array, the first is taken as a type code specifing the
+conversion type, and the second is taken as the data:
+
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ $GetData::UINT8, @data)
+
+=item 4.
+
+Otherwise, if only two arguments make up the data argument list, and the second
+is not a reference to an array, the first is, again, taken as a type code, and
+the second is assumed to be a packed string containing the data in a format
+appropriate for the type code specified:
+
+ $packed_data = pack("C", @data)
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ $GetData::UINT8, $packed_data)
+
+=item 5.
+
+Otherwise, finally, the data argument list elements are simply taken as data
+themselves:
+
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ @data)
+
+or
+
+ $dirfile->putdata("field_code", $first_frame, $first_sample,
+ $data[0], $data[1], $data[2], ...)
+
+
+=back
+
+GetData internally converts the Perl data into a format readably by the C API.
+In cases 3 and 4 above, the type the data is converted into is specified
+explicitly in the call. In the other cases, GetData must guess an appropriate
+C type into which to convert the data. It does so by looking at the first
+data value:
+
+=over
+
+=item *
+
+if the value is a C<Math::Complex> object, the data are converted to double
+precision complex data (C<COMPLEX128>)
+
+=item *
+
+if the value is an integer, the data are converted to a 64-bit signed integer
+(C<INT64>)
+
+=item *
+
+otherwise, the data are converted to a double precision float (C<FLOAT64>).
+
+=back
+
+Of the above methods, the first is only necessary when the data array has only
+two elements, and so would be mistaken for method four if specified without the
+initial undef. Furthermore, the fourth method is typically the most efficient,
+since the packed data scalar can often be used as the input to the C API without
+need for type conversion.
+
+=head1 ENTRY HASHES
+
+The replacement for the C<gd_entry_t> object of the C API is a simple hash. The
+key names are the same as the names of the C<gd_entry_t> members. (See
+gd_entry(3) for details).
+
+In entry hashes returned by GetData, only those keys appropriate for the entry
+type specified will be present. Entry hashes passed to GetData from the caller
+may have other keys than those required by the entry type. They will be
+ignored.
+
+The value associated with the C<field_type> key will be one of the symbols
+listed under L</"Entry Types"> above. For entry types which have (potentially)
+more than one input field (DIVIDE, LINCOM, MPLEX, MULTIPLY, WINDOW), the value
+associated with the C<"in_fields"> key will be a list of strings, regardless of
+how many elements it has; other entry types which provide C<"in_fields"> will be
+a scalar, even though the key name is still plural.
+
+Elements of the C<scalar> array which are undef indicate literal parameters
+(equivalent to C<NULL> in the C<gd_entry_t>'s C<scalar> member). Similarly,
+undef is used in C<scalar_ind> where the C API uses -1, to indicate CONST
+fields, instead of CARRAYs.
+
+=head1 DIRFILE CREATION METHODS
+
+=over
+
+=item open ($DIRFILENAME, $FLAGS, $SEHANDLER=undef, $EXTRA=undef)
+
+Create or open a Dirfile database called C<$DIRFILENAME>. C<$FLAGS> should be
+either C<$GetData::RDONLY> (for read-only access) or C<$GetData::RDWR> (for
+read-write access), optionally bitwise or'd with any of the following flags:
+
+=over
+
+$GetData::ARM_ENDIAN,
+$GetData::BIG_ENDIAN,
+$GetData::CREAT,
+$GetData::EXCL,
+$GetData::FORCE_ENCODING,
+$GetData::FORCE_ENDIAN,
+$GetData::IGNORE_DUPS,
+$GetData::IGNORE_REFS,
+$GetData::LITTLE_ENDIAN,
+$GetData::NOT_ARM_ENDIAN,
+$GetData::PEDANTIC,
+$GetData::PERMISSIVE,
+$GetData::PRETTY_PRINT,
+$GetData::TRUNC,
+$GetData::TRUNCSUB,
+$GetData::VERBOSE,
+
+=back
+
+and at most one of the encoding symbols listed above in the L</"Encoding Types">
+section or else C<$GetData::AUTO_ENCODED> indicating that GetData should attempt
+to automatically determine the encoding. The meaning of the dirfile flags
+may be found 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. When
+called, C<$SEHANDLER> will be passed two arguments. The first is a reference to
+a hash containing the parser data. The second is the C<$EXTRA> scalar passed to
+this method. C<$SEHANDLER> is called in scalar context, and should return
+either:
+
+=over
+
+=item *
+
+an integer, one of the symbolic constants:
+
+=over
+
+$GetData::SYNTAX_ABORT,
+$GetData::SYNTAX_CONTINUE,
+$GetData::SYNTAX_IGNORE,
+$GetData::SYNTAX_RESCAN;
+
+=back
+
+(see gd_cbopen(3) for their meaning), or
+
+=item *
+
+a string containing the corrected line, in which case C<$GetData::SYNTAX_RESCAN>
+is assumed; or,
+
+=item *
+
+a reference to a list consisting of an integer, one of the
+C<$GetData::SYNTAX_...> constants listed above, 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
+the caller should use the returned dirfile's L<error>() method to test for
success.
+=item invalid_dirfile ()
+
+This function always returns a newly created, but invalid, Dirfile object.
+Unlike an invalid dirfile created (either accidentally or purposefully) using
+L<open>(), the dirfile returned by this function always has a zero error code.
+See gd_invalid_dirfile(3).
+
=back
+=head1 DIRFILE OBJECT METHODS
+
+The following methods all operate on a dirfile object returned by one of the
+above methods and can either be called as:
+
+ $GetData::method($dirfile, ...)
+
+or else, as
+
+ $dirfile->method(...)
+
+without change in operation.
+
+=head2 List of Methods
+
+=over
+
+=item $dirfile->add_carray ($FIELD_NAME, $DATA_TYPE, $FRAGMENT_INDEX,
+{DATA...})
+
+Adds a new CARRAY field called C<$FIELD_NAME> to the metadata fragment indexed
+by C<$FRAGMENT_INDEX>. The storage type of the CARRAY is given by
+C<$DATA_TYPE>, which should be one of the symbols listed above under
+L</"Data Types">. The value of the CARRAY is then set to the data given in
+the C<{DATA...}> argument list, which also determines its length. See the
+L</"Input Data"> section above for details on the allowed forms of C<{DATA...}>.
+See gd_add_carray(3).
+
+=item $dirfile->add_const ($FIELD_NAME, $DATA_TYPE, [$VALUE, $FRAGMENT_INDEX])
+
+Adds a new CONST field called C<$FIELD_NAME> to the metadata fragment indexed
+by C<$FRAGMENT_INDEX>, or to the primary format file if omitted. The
+C<$DATA_TYPE> argument indicates the storage type, which should be one of the
+symbols listed above under L</"Data Types">. If given, the value of the field
+is set to C<$VALUE>, otherwise the field will be initialised to zero. See
+gd_add_const(3).
+
+=item $dirfile->aliases ($FIELD_CODE)
+
+In scalar context, returns the number of aliases of C<$FIELD_CODE>. In list
+context, returns an array of alias names for C<$FIELD_CODE>. See gd_naliases(3)
+and gd_aliases(3).
+
+=item $dirfile->carrays ($RETURN_TYPE)
+
+Returns the value of all carrays (excluding metafields) in the dirfile after
+converting them to the return type C<$RETURN_TYPE>, which should be one of the
+symbols listed under L</"Data Types"> above. If called in scalar context,
+returns a reference to an array of packed string data. If called in list
+context, returns an array of arrays of unpacked data. See gd_carrays(3).
+
+=item $dirfile->close ()
+
+Closes the dirfile, writing changes to disk. Upon successful completion, the
+dirfile object will be invalidated, prohibiting further operation on it. A
+dirfile which is destroyed by garbage collection is discarded (see L</"discard">
+below). This function should be called if metadata need to be written to disk
+before the object goes out of scope. See gd_close(3).
+
+=item $dirfile->constants ($RETURN_TYPE)
+
+Returns the value of all constants (excluding metafields) in the dirfile after
+converting them to the return type C<$RETURN_TYPE>, which should be one of the
+symbols listed under L</"Data Types"> above. If called in scalar context,
+returns a packed string containing the data. If called in list context, the
+data will be unpacked and returned as an array. See gd_constants(3).
+
+=item $dirfile->discard ()
+
+Closes the dirfile, ignoring changes to metadata, but writing changed data to
+disk. Upon successful completion, the dirfile object will be invalidated,
+prohibiting further operation on it. This function is called automatically by
+the dirfile destructor, and need not be called explicitly. To save the metadata
+on close, use L</close>. See gd_discard(3).
+
+=item $dirfile->entry ($FIELD_CODE)
+
+If called in scalar context, returns the entry type of C<$FIELD_CODE>, one
+of the symbols listed above under L</"Entry Types">. In array context, returns
+a hash describing the indicated field. See gd_entry_type(3) and gd_entry(3).
+
+=item $dirfile->entry_list ($PARENT, $TYPE, $FLAGS)
+
+In scalar context, returns the number of entries matching the supplied criteria.
+In list context, returns an array of the names of the entries. If C<$PARENT>
+is undef, top-level entries are considered, otherwise meta entries under
+C<$PARENT> are considered. If C<$TYPE> is one of the entry types listed above
+under L</"Entry Types">, only entries of that type are considered. Alternatley,
+C<$TYPE> may be one of:
+
+=over
+
+$GetData::ALL_ENTRIES,
+$GetData::SCALAR_ENTRIES,
+$GetData::VECTOR_ENTRIES.
+
+=back
+
+Setting C<$TYPE> to undef is equivalent to setting it to
+C<$GetData::ALL_ENTRIES>. If not undef, which is treated as zero, C<$FLAGS>
+should be zero or more of the following flags:
+
+=over
+
+$GetData::ENTRIES_HIDDEN,
+$GetData::ENTRIES_NOALIAS.
+
+=back
+
+See gd_nentries(3) and gd_entry_list(3) for the meaning of these symbols.
+
+=item $dirfile->error ()
+
+Returns the error code of the last operation on this dirfile. See gd_error(3).
+
+=item $dirfile->error_string ()
+
+Returns a string describing the error encountered (if any) by the last operation
+on this dirfile. See gd_error_string(3).
+
+=item $dirfile->field_list ()
+
+Equivalent to: C<$dirfile-E<gt>entry_list(undef, undef, undef)>.
+
+=item $dirfile->field_list_by_type ($TYPE)
+
+Equivalent to: C<$dirfile-E<gt>entry_list(undef, $TYPE, undef)>.
+
+=item $dirfile->fragment_affixes ($FRAGMENT_INDEX)
+
+Returns an array containing the prefix (first) and suffix (second) of the
+fragment indexed by C<$FRAGMENT_INDEX>. See gd_fragment_affixes(3).
+
+=item $dirfile->fragments ()
+
+In scalar context, returns the number of metadata fragments in the dirfile.
+In list context, returns an array of pathnames to the fragments on disk, in the
+order that they're indexed. See gd_nfragments(3) and gd_fragmentname(3).
+
+=item $dirfile->get_carray ($FIELD_CODE, $RETURN_TYPE)
+
+Returns the value of the CARRAY named C<$FIELD_CODE> after converting its
+elements to the return type C<$RETURN_TYPE>, which should be one of the symbols
+listed under L</"Data Types"> above. If called in scalar context, returns a
+packed string containing the data. If called in list context, the data will be
+unpacked and returned as an array. See gd_get_carray(3).
+
+=item $dirfile->get_carray_slice ($FIELD_CODE, $START, $LEN, $RETURN_TYPE)
+
+Returns the value of a portion of the CARRAY named C<$FIELD_CODE> after
+converting its elements to the return type C<$RETURN_TYPE>, which should be one
+of the symbols listed under L</"Data Types"> above. The first element returned
+is given by C<$START>, and the number of elements by C<$LEN>. If called in
+scalar context, returns a packed string containing the data. If called in list
+context, the data will be unpacked and returned as an array. Less data than
+requested may be returned, if insufficient data exists. See
+gd_get_carray_slice(3).
+
+=item $dirfile->get_constant ($FIELD_CODE, $RETURN_TYPE)
+
+Returns the value of the CONST named C<$FIELD_CODE> after converting it to the
+return type C<$RETURN_TYPE>, which should be one of the symbols listed under
+L</"Data Types"> above. See gd_get_constant(3).
+
+=item $dirfile->getdata ($FIELD_CODE, $FIRST_FRAME, $FIRST_SAMP, $NUM_FRAMES,
+$NUM_SAMP, $RETURN_TYPE)
+
+Returns data from the field specified by C<$FIELD_CODE> after converting them
+to the return type C<$RETURN_TYPE>, which should be one of the symbols listed
+under L</"Data Types"> above. The first sample returned is C<$FIRST_SAMP>
+samples after the start of C<$FIRST_FRAME> and the amount of data returned is
+L<$NUM_FRAMES> frames plus L<$NUM_SAMP> samples. If called in scalar context
+returns a string of packed data. If called in array context, the data will be
+unpacked and returned as an array. Complex data are returned as
+C<Math::Complex> objects. See gd_getdata(3).
+
+=item $dirfile->get_string ($FIELD_CODE)
+
+Returns the value of the STRING named C<$FIELD_CODE>. See gd_get_string(3).
+
+=item $dirfile->include ($FILE, $PARENT_FRAGMENT, $FLAGS, [$PREFIX, $SUFFIX])
+
+Includes the fragment metadata file C<$FILE> under the fragment indexed by
+C<$PARENT_FRAGMENT>. C<$FLAGS> should be a bitwise or'd collection of zero or
+more of the following flags:
+
+=over
+
+$GetData::BIG_ENDIAN,
+$GetData::CREAT,
+$GetData::EXCL,
+$GetData::FORCE_ENCODING,
+$GetData::FORCE_ENDIAN,
+$GetData::IGNORE_DUPS,
+$GetData::IGNORE_REFS,
+$GetData::LITTLE_ENDIAN,
+$GetData::PEDANTIC,
+$GetData::TRUNC,
+
+=back
+
+and at most one of the encoding symbols listed above in the L</"Encoding Types">
+section or else C<$GetData::AUTO_ENCODED> indicating that GetData should attempt
+to automatically determine the encoding. If C<$PREFIX> or C<$SUFFIX> are
+omitted or undef, the added fragment will contain no such affix. See
+gd_include_affix(3).
+
+=item $dirfile->madd_carray ($PARENT, $FIELD_NAME, $DATA_TYPE, {DATA...})
+
+Adds a new CARRAY metafield called C<$FIELD_NAME> under the parent field
+C<$PARENT>. The storage type of the CARRAY is given by C<$DATA_TYPE>, which
+should be one of the symbols listed above under L</"Data Types">. The value of
+the CARRAY is then set to the data given in the C<{DATA...}> argument list,
+which also determines its length. See the L</"Input Data"> section above for
+details on the allowed forms of C<{DATA...}>. See gd_madd_carray(3).
+
+=item $dirfile->madd_const ($PARENT, $FIELD_NAME, $DATA_TYPE, [$VALUE])
+
+Adds a new CONST metafield called C<$FIELD_NAME> under the field C<$PARENT>.
+The C<$DATA_TYPE> argument indicates the storage type, which should be one of
+the symbols listed above under L</"Data Types">. If given, the value of the
+field is set to C<$VALUE>, otherwise the field will be initialised to zero.
+See gd_madd_const(3).
+
+=item $dirfile->mcarrays ($PARENT, $RETURN_TYPE)
+
+Behaves analogously to L<carrays>() (I<q.v.>), but returns CARRAYs which are
+metafields under the parent specified by C<$PARENT>.
+
+=item $dirfile->mconstants ($PARENT, $RETURN_TYPE)
+
+Behaves analogously to L<constants>() (I<q.v.>), but returns CONSTs which are
+metafields under the parent specified by C<$PARENT>.
+
+=item $dirfile->mfield_list ($PARENT)
+
+Equivalent to C<$dirfile-E<gt>entry_list($PARENT, undef, undef)>.
+
+=item $dirfile->mfield_list_by_type ($PARENT, $TYPE)
+
+Equivalent to C<$dirfile-E<gt>entry_list($PARENT, $TYPE, undef)>.
+
+=item $dirfile->mstrings ($PARENT)
+
+Behaves analogously to L<strings>() (I<q.v.>), but returns STRINGs which are
+metafields under the parent specified by C<$PARENT>.
+
+=item $dirfile->mvector_list ($PARENT)
+
+Equivalent to:
+ $dirfile-E<gt>entry_list($PARENT, $GetData::VECTOR_ENTRIES, undef).
+
+=item $dirfile->parser_callback ($SEHANDLER, $EXTRA=undef)
+
+Sets the registered parser callback function for the dirfile to C<$SEHANDLER>,
+or to nothing if undef, and updates the C<...
[truncated message content] |
|
From: <ket...@us...> - 2012-04-20 01:05:16
|
Revision: 704
http://getdata.svn.sourceforge.net/getdata/?rev=704&view=rev
Author: ketiltrout
Date: 2012-04-20 01:05:08 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
Install perl.
Modified Paths:
--------------
trunk/getdata/Makefile.am
trunk/getdata/bindings/perl/Makefile.am
trunk/getdata/doc/Makefile.am
trunk/getdata/m4/perl.m4
trunk/getdata/man/Makefile.am
Modified: trunk/getdata/Makefile.am
===================================================================
--- trunk/getdata/Makefile.am 2012-04-19 23:41:04 UTC (rev 703)
+++ trunk/getdata/Makefile.am 2012-04-20 01:05:08 UTC (rev 704)
@@ -35,6 +35,7 @@
gpg -abo $@ $<
DISTCHECK_CONFIGURE_FLAGS = --with-idl-dlm-dir="$$dc_install_base/idl" \
+ --with-perl-dir="$$dc_install_base/perl" \
--with-python-module-dir="$$dc_install_base/python"
# idl-only package
Modified: trunk/getdata/bindings/perl/Makefile.am
===================================================================
--- trunk/getdata/bindings/perl/Makefile.am 2012-04-19 23:41:04 UTC (rev 703)
+++ trunk/getdata/bindings/perl/Makefile.am 2012-04-20 01:05:08 UTC (rev 704)
@@ -21,7 +21,7 @@
AUTOMAKE_OPTIONS = foreign
EXTRA_DIST=funclist.pl GetData.xs simple_funcs.pl simple_funcs.xsin typemap \
- GetData.pm.in MANIFEST.in test/*.t
+ GetData.pm.in MANIFEST.in test/big_test.t test/callback.t
if GETDATA_DEBUG
TEST_VERBOSE=verbose=1
@@ -29,6 +29,14 @@
PERL_TESTS=t/big_test.t t/callback.t
+man3dir=${perlmandir}
+nodist_man3_MANS=blib/libdoc/GetData.3
+
+nodist_perl_SCRIPTS=blib/lib/GetData.pm
+
+perlautogetdatadir=${perldir}/auto/GetData
+nodist_perlautogetdata_SCRIPTS=blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so
+
t:
mkdir t
@@ -38,15 +46,13 @@
lib:
mkdir lib
-lib/GetData.xs: GetData.xs
- $(MAKE) lib
+lib/GetData.xs: lib GetData.xs
cat $(srcdir)/GetData.xs > $@
-lib/typemap: typemap
- $(MAKE) lib
+lib/typemap: lib typemap
cat $(srcdir)/typemap > $@
-lib/simple_funcs.xs: simple_funcs.xsin simple_funcs.pl
+lib/simple_funcs.xs: lib simple_funcs.xsin simple_funcs.pl
$(PERL) $(srcdir)/simple_funcs.pl $(srcdir)/simple_funcs.xsin > $@
MANIFEST: MANIFEST.in
@@ -65,25 +71,36 @@
$(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@
chmod a-w $@
-all-local: lib blib/arch/auto/GetData/GetData.bs
-
-blib/arch/auto/GetData/GetData.bs: Build
+blib/arch/auto/GetData/GetData.bs: Build lib/GetData.xs lib/simple_funcs.xs \
+ lib/typemap
$(PERL) Build build
touch $@
+blib/arch/auto/GetData/GetData.so: blib/arch/auto/GetData/GetData.bs
+ touch $@
+
+blib/lib/GetData.pm: blib/arch/auto/GetData/GetData.bs
+ touch $@
+
+blib/libdoc/GetData.3: blib/arch/auto/GetData/GetData.bs
+ touch $@
+
.PRECIOUS: Build
Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \
MANIFEST
$(PERL) Build.PL
clean-local:
- rm -rf lib
+ rm -rf lib blib
if test -e Build; then \
$(PERL) Build clean; \
fi
rm -f $(BUILT_SOURCES) make_parameters.sed MYMETA.yml MYMETA.json GetData.pm
rm -rf Build _build MANIFEST t
+uninstall-hook:
+ rmdir $(DESTDIR)${perlautogetdatadir}
+
if TEST_PERL
check: $(PERL_TESTS)
${DL_LIBRARY_PATH}=${${DL_LIBRARY_PATH}}:../../src/.libs $(PERL) ./Build test ${TEST_VERBOSE}
Modified: trunk/getdata/doc/Makefile.am
===================================================================
--- trunk/getdata/doc/Makefile.am 2012-04-19 23:41:04 UTC (rev 703)
+++ trunk/getdata/doc/Makefile.am 2012-04-20 01:05:08 UTC (rev 704)
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 D. V. Wiebe
+# Copyright (C) 2008, 2012 D. V. Wiebe
#
##########################################################################
#
@@ -36,12 +36,16 @@
READMEIDL=README.idl
endif
+if MAKE_PERLBINDINGS
+READMEPERL=README.perl
+endif
+
if MAKE_PYBINDINGS
READMEPYTHON=README.python
endif
dist_doc_DATA = ${READMECXX} ${READMEF77} ${READMEF95} ${READMEIDL} \
- ${READMEPYTHON} unclean_database_recovery.txt
+ ${READMEPERL} ${READMEPYTHON} unclean_database_recovery.txt
clean-local:
rm -rf *~
Modified: trunk/getdata/m4/perl.m4
===================================================================
--- trunk/getdata/m4/perl.m4 2012-04-19 23:41:04 UTC (rev 703)
+++ trunk/getdata/m4/perl.m4 2012-04-20 01:05:08 UTC (rev 704)
@@ -176,5 +176,9 @@
AC_SUBST([perldir])
AC_MSG_RESULT([$perldir])
+ AC_MSG_CHECKING([Perl man directory])
+ AC_SUBST([perlmandir])
+ AC_MSG_RESULT([$perlmandir])
+
fi
])
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2012-04-19 23:41:04 UTC (rev 703)
+++ trunk/getdata/man/Makefile.am 2012-04-20 01:05:08 UTC (rev 704)
@@ -68,7 +68,7 @@
gd_madd_bit.3:gd_madd_lincom.3 gd_madd_bit.3:gd_madd_linterp.3 \
gd_madd_bit.3:gd_madd_mplex.3 gd_madd_bit.3:gd_madd_multiply.3 \
gd_madd_bit.3:gd_madd_phase.3 gd_madd_bit.3:gd_madd_polynom.3 \
- d_madd_bit.3:gd_madd_recip.3 gd_madd_bit.3:gd_madd_sbit.3 \
+ gd_madd_bit.3:gd_madd_recip.3 gd_madd_bit.3:gd_madd_sbit.3 \
gd_madd_bit.3:gd_madd_string.3 gd_madd_bit.3:gd_madd_window.3 \
gd_add.3:gd_madd.3 \
gd_add_spec.3:gd_madd_spec.3 \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-04-21 02:52:50
|
Revision: 705
http://getdata.svn.sourceforge.net/getdata/?rev=705&view=rev
Author: ketiltrout
Date: 2012-04-21 02:52:38 +0000 (Sat, 21 Apr 2012)
Log Message:
-----------
* gd_mplex_lookback returns void
* html-man improvements; doc updates.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/bindings/cxx/dirfile.cpp
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/perl/simple_funcs.pl
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/python/pydirfile.c
trunk/getdata/doc/README.cxx
trunk/getdata/man/Makefile.am
trunk/getdata/man/dirfile-encoding.5
trunk/getdata/man/dirfile-format.5
trunk/getdata/man/dirfile.5
trunk/getdata/man/dirfile2ascii.1
trunk/getdata/man/gd_alias_target.3
trunk/getdata/man/gd_cbopen.3
trunk/getdata/man/gd_encoding.3
trunk/getdata/man/gd_entry.3
trunk/getdata/man/gd_entry_list.3
trunk/getdata/man/gd_entry_type.3
trunk/getdata/man/gd_error_count.3
trunk/getdata/man/gd_get_carray_slice.3
trunk/getdata/man/gd_get_constant.3
trunk/getdata/man/gd_getdata.3
trunk/getdata/man/gd_include_affix.3
trunk/getdata/man/gd_madd_bit.3
trunk/getdata/man/gd_mplex_lookback.3
trunk/getdata/man/gd_nentries.3
trunk/getdata/man/gd_parent_fragment.3
trunk/getdata/man/gd_put_carray_slice.3
trunk/getdata/man/gd_put_constant.3
trunk/getdata/man/gd_putdata.3
trunk/getdata/man/make_html.pl
trunk/getdata/src/getdata.h.in
trunk/getdata/src/globals.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/ChangeLog 2012-04-21 02:52:38 UTC (rev 705)
@@ -1,3 +1,10 @@
+2012-04-21 D. V. Wiebe <ge...@ke...> svn:705
+ * man/make_html.pl: Improvements.
+
+ * src/globals.c (gd_mplex_lookback): Always succeed; return void.
+
+ * bindings/perl/simple_funcs.pl: Handle returning void.
+
2012-04-19 D. V. Wiebe <ge...@ke...> svn:701
* src/add.c (_GD_Add): Don't check protection level before figuring out the
fragment index.
Modified: trunk/getdata/bindings/cxx/dirfile.cpp
===================================================================
--- trunk/getdata/bindings/cxx/dirfile.cpp 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/bindings/cxx/dirfile.cpp 2012-04-21 02:52:38 UTC (rev 705)
@@ -550,9 +550,9 @@
return gd_verbose_prefix(D, prefix);
}
-int Dirfile::MplexLookback(int lookback) const
+void Dirfile::MplexLookback(int lookback) const
{
- return gd_mplex_lookback(D, lookback);
+ gd_mplex_lookback(D, lookback);
}
unsigned int Dirfile::NEntries(const char *parent, unsigned int type,
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-04-21 02:52:38 UTC (rev 705)
@@ -194,7 +194,7 @@
const char **MFieldListByType(const char *parent, EntryType type) const;
- int MplexLookback(int lookback) const;
+ void MplexLookback(int lookback) const;
const char **MStrings(const char *parent) const;
Modified: trunk/getdata/bindings/perl/simple_funcs.pl
===================================================================
--- trunk/getdata/bindings/perl/simple_funcs.pl 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/bindings/perl/simple_funcs.pl 2012-04-21 02:52:38 UTC (rev 705)
@@ -135,10 +135,24 @@
print "\tCODE:\n\t\tdtrace(\"", join(", ", map(printfmt($_), @argtype));
print "\", ", join(", ", map(printmunge($_), @arg)), ");\n";
- print "\t\tRETVAL = ";
+
+ print "\t\t";
+ if ($ret ne "void") {
+ print "RETVAL = ";
+ }
print (($lfs) ? "gdp64(gd_$func)" : "gd_$func");
- print "($arglist);\n\t\tGDP_UNDEF_ON_ERROR();\n\tOUTPUT:\n";
- print "\t\tRETVAL\n\tCLEANUP:\n", map(printcleanup($_), @arg);
- print "\t\tdreturn(\"", &printfmt($ret), "\", ";
- print &printmunge([$ret, "RETVAL"]), ");\n\n";
+ print "($arglist);\n";
+
+ if ($ret ne "void") {
+ print "\t\tGDP_UNDEF_ON_ERROR();\n";
+ print "\tOUTPUT:\n\t\tRETVAL\n";
+ }
+
+ print "\tCLEANUP:\n", map(printcleanup($_), @arg);
+ if ($ret eq "void") {
+ print "\t\tdreturnvoid();\n\n";
+ } else {
+ print "\t\tdreturn(\"", &printfmt($ret), "\", ";
+ print &printmunge([$ret, "RETVAL"]), ");\n\n";
+ }
}
Modified: trunk/getdata/bindings/perl/simple_funcs.xsin
===================================================================
--- trunk/getdata/bindings/perl/simple_funcs.xsin 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/bindings/perl/simple_funcs.xsin 2012-04-21 02:52:38 UTC (rev 705)
@@ -153,4 +153,4 @@
unsigned long int flags(DIRFILE *dirfile, unsigned long int set=0,
unsigned long int reset=0)
int verbose_prefix(DIRFILE *dirfile, gdpu_char *prefix=NULL)
-int mplex_lookback(DIRFILE *dirfile, int lookback)
+void mplex_lookback(DIRFILE *dirfile, int lookback)
Modified: trunk/getdata/bindings/python/pydirfile.c
===================================================================
--- trunk/getdata/bindings/python/pydirfile.c 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/bindings/python/pydirfile.c 2012-04-21 02:52:38 UTC (rev 705)
@@ -134,7 +134,7 @@
if (self) {
self->D = NULL;
- self->mplex_lookback = 10;
+ self->mplex_lookback = GD_DEFAULT_LOOKBACK;
self->verbose_prefix = NULL;
self->callback = NULL;
self->callback_data = NULL;
Modified: trunk/getdata/doc/README.cxx
===================================================================
--- trunk/getdata/doc/README.cxx 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/doc/README.cxx 2012-04-21 02:52:38 UTC (rev 705)
@@ -250,7 +250,7 @@
* const char **Dirfile::MFieldList(const char *parent)
* const char **Dirfile::MFieldListByType(const char *parent,
GetData::EntryType type)
-* int MplexLookback(int lookback)
+* void MplexLookback(int lookback)
* int Dirfile::MoveAlias(const char* field_code, int new_fragment)
* const char **Dirfile::MStrings(const char *parent)
* const char **Dirfile::MVectorList(const char *parent)
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/Makefile.am 2012-04-21 02:52:38 UTC (rev 705)
@@ -105,7 +105,7 @@
HTMLMANS=$(addsuffix .html,$(nodist_man_MANS)) \
$(addsuffix .html,$(dist_man_MANS))
-%.html: %
+%.html: % make_html.pl
./make_html.pl $< > $@
htmlman: $(HTMLMANS)
Modified: trunk/getdata/man/dirfile-encoding.5
===================================================================
--- trunk/getdata/man/dirfile-encoding.5 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/dirfile-encoding.5 2012-04-21 02:52:38 UTC (rev 705)
@@ -118,7 +118,7 @@
GetData caches an uncompressed megabyte of data at a time to speed access times.
A call to
-.BR get_nframes (3)
+.BR gd_nframes (3)
requires decompression of the entire binary file to determine its uncompressed
size, and may take some time to complete.
The file extension of the BZip2 Encoding is
@@ -137,7 +137,7 @@
being written to usually doesn't work.
To speed the operation of
-.BR get_nframes (3),
+.BR gd_nframes (3),
the GZip Encoding takes the uncompressed size of the file the gzip footer, which
contains the file's uncompressed size in bytes, modulo 2**32. As a result,
using a field with an (uncompressed) binary file size larger than 4\~GiB as the
@@ -159,7 +159,7 @@
As with the BZip2 Encoding, GetData caches an uncompressed megabyte of data at a
time to speed access times. A call to
-.BR get_nframes (3)
+.BR gd_nframes (3)
requires decompression of the entire binary file to determine its uncompressed
size, and may take some time to complete.
The file extension of the LZMA Encoding is
@@ -248,7 +248,7 @@
.BR gd_open (3)
is required to read ZZSlim encoded data. The file extension of the ZZSlim
Encoding is
-.BR zip .
+.BR .zip .
.SH AUTHOR
Modified: trunk/getdata/man/dirfile-format.5
===================================================================
--- trunk/getdata/man/dirfile-format.5 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/dirfile-format.5 2012-04-21 02:52:38 UTC (rev 705)
@@ -208,11 +208,12 @@
requriement that the input fields of a derived field exist
.RI ( q.v. ),
it is not an error for the target of an alias to not exist. Syntax is:
+.IP
.RS
-.IP
.B /ALIAS
.I <name> <target>
-.PP
+.RE
+.IP
A metafield alias may defined by using the
.IR <parent-field> / <alias-name>
syntax for
@@ -222,10 +223,11 @@
specifically, a metafield alias may target a top-level field, or a metafield
of with a different parent; conversely, a top-level alias may target a
metafield.
-.PP
+.IP
A metafield alias may never appear as the parent part of a metafield field code,
even if it refers to a top-level field. That is, given the valid format:
.IP
+.RS
field1 \fBRAW UINT8\fR 1
.br
field1/meta \fBCONST FLOAT64\fR 0.0
@@ -233,7 +235,8 @@
field2 \fBRAW UINT8\fR 1
.br
\fB/ALIAS\fR field2/alias field1
-.PP
+.RE
+.IP
The metafield
.I field1/meta
may not be referred to as
@@ -242,10 +245,9 @@
.I field2/alias
is a valid field code referring to
.IR field1 .
-.PP
+.IP
The /ALIAS directive has no scope: it is processed immediately. It appeared in
Standards Version 9.
-.RE
.TP
.B /ENCODING
The /ENCODING directive specifies the encoding scheme used to encode binary
@@ -1032,10 +1034,10 @@
.IR i ", " S
INT32
.TP
-.IR f
+.I f
FLOAT32
.TP
-.IR d
+.I d
FLOAT64
.RE
@@ -1140,50 +1142,50 @@
is one of the following tokens indicating the particular comparison performed:
.RS
.TP
-.B EQ
+.I EQ
data are extracted where
.IR check ,
converted to a 64-bit signed integer, equals
.IR threshold ,
.TP
-.B GE
+.I GE
data are extracted where
.IR check ,
converted to a 64-bit floating-point number, is greater than or equal to
.IR threshold ,
.TP
-.B GT
+.I GT
data are extracted where
.IR check ,
converted to a 64-bit floating-point number, is strictly greater than
.IR threshold ,
.TP
-.B LE
+.I LE
data are extracted where
.IR check ,
converted to a 64-bit floating-point number, is less than or equal to
.IR threshold ,
.TP
-.B LT
+.I LT
data are extracted where
.IR check ,
converted to a 64-bit floating-point number, is strictly less than
.IR threshold ,
.TP
-.B NE
+.I NE
data are extracted where
.IR check ,
converted to a 64-bit signed integer, is not equal to
.IR threshold ,
.TP
-.B SET
+.I SET
data are extracted where at least one bit set in
.IR threshold
is also set in
.IR check ,
when converted to a 64-bit unsigned integer,
.TP
-.B CLR
+.I CLR
data are extracted where at least one bit set in
.IR threshold
is not set in
@@ -1293,7 +1295,7 @@
.RB ( ; )
with no intervening whitespace. So, for example, the tokens
.IP
-1;0 0;1 4;0 0;5 9.313e2;74.1
+1;0 \t 0;1 \t 4;0 \t 0;5 \t 9.313e2;74.1
.PP
represent, respectively, the real unit, the imaginary unit, the real number
four, the imaginary number
Modified: trunk/getdata/man/dirfile.5
===================================================================
--- trunk/getdata/man/dirfile.5 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/dirfile.5 2012-04-21 02:52:38 UTC (rev 705)
@@ -126,12 +126,11 @@
.SH AUTHORS
-The dirfile specification was developed by C. B. Netterfield
+The Dirfile format was developed by C. B. Netterfield
.nh
<net...@as...>.
.hy 1
-
-The dirfile specification is now maintained by D. V. Wiebe
+It is now maintained by D. V. Wiebe
.nh
<ge...@ke...>.
.hy 1
Modified: trunk/getdata/man/dirfile2ascii.1
===================================================================
--- trunk/getdata/man/dirfile2ascii.1 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/dirfile2ascii.1 2012-04-21 02:52:38 UTC (rev 705)
@@ -19,7 +19,7 @@
.SH SYNOPSIS
.nh
.ad l
-.TP
+.HP
\fBdirfile2ascii\fR [ \fIOPTION\fR ]... \fIDIRFILE\fR
.RB "[ [ " \-a " | " \-A " | " \-e " | " \-E " | " \-F " | " \-g " | " \-G " |"
.BR \-o " | " \-i " | " \-u " | " \-x " | " \-X " ]"
Modified: trunk/getdata/man/gd_alias_target.3
===================================================================
--- trunk/getdata/man/gd_alias_target.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_alias_target.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -21,8 +21,8 @@
.HP
.nh
.ad l
-.BI "const char *gd_alias_target(DIRFILE *" dirfile ", const char *" alias_name
-.B );
+.BI "const char *gd_alias_target(DIRFILE *" dirfile ,
+.BI "const char *" alias_name );
.hy
.ad n
.SH DESCRIPTION
Modified: trunk/getdata/man/gd_cbopen.3
===================================================================
--- trunk/getdata/man/gd_cbopen.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_cbopen.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -69,8 +69,8 @@
(read-write), and may also contain zero or more of the following flags,
bitwise-or'd together:
.PP
-.B GD_ARM_ENDIAN
.PD 0
+.B GD_ARM_ENDIAN
.TP
.PD
.B GD_NOT_ARM_ENDIAN
@@ -91,8 +91,8 @@
indicates the native behaviour of the platform. That symbol will equal zero,
and may be omitted.
.PP
-.B GD_BIG_ENDIAN
.PD 0
+.B GD_BIG_ENDIAN
.TP
.PD
.B GD_LITTLE_ENDIAN
@@ -139,9 +139,10 @@
.BR GD_CREAT ,
the call will fail if the dirfile specified by
.I dirfilename
-already exists. Behaviour of this flag is undefined if
+already exists. If
.B GD_CREAT
-is not specified. This flag suffers from all the limitations of the
+is not specified, this flag is ignored. This flag suffers from all the
+limitations of the
.B O_EXCL
flag as indicated in
.BR open (2).
@@ -512,6 +513,10 @@
.B GD_E_FORMAT_METARAW
An attempt was made to add a RAW metafield.
.TP
+.B GD_E_FORMAT_MPLEXVAL
+A MPLEX specification has a negative count_max or count_val, or else had
+a positive count_max, and count_val was larger than it.
+.TP
.B GD_E_FORMAT_N_FIELDS
The number of fields of a LINCOM field was out-of-range.
.TP
@@ -541,18 +546,6 @@
.TP
.B GD_E_FORMAT_WINDOP
The operation in a WINDOW field was not recognised.
-.TP
-.B GD_E_FORMAT_META_META
-A
-.B /META
-directive used a metafield for the parent field for the definition.
-.TP
-.B GD_E_FORMAT_ALIAS
-A metafield specification uses an alias for the parent field.
-.TP
-.B GD_E_FORMAT_MPLEXVAL
-A MPLEX specification has a negative count_max or count_val, or else had
-a positive count_max, and count_val was larger than it.
.PP
.IR pdata -> filename
and
Modified: trunk/getdata/man/gd_encoding.3
===================================================================
--- trunk/getdata/man/gd_encoding.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_encoding.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -1,6 +1,6 @@
.\" gd_encoding.3. The gd_encoding man page.
.\"
-.\" Copyright (C) 2008, 2009, 2010 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2012 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_encoding 3 "15 July 2010" "Version 0.7.0" "GETDATA"
+.TH gd_encoding 3 "21 April 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_encoding \(em report the binary encoding of data in a dirfile
.SH SYNOPSIS
@@ -47,19 +47,26 @@
.IP
.nh
.ad l
-.BR GD_UNENCODED ,\~ GD_TEXT_ENCODED ,\~ GD_SLIM_ENCODED ,\~
-.BR GD_GZIP_ENCODED ,\~ GD_BZIP2_ENCODED ,\~ GD_LZMA_ENCODED ,\~
+.BR GD_UNENCODED ,
+.BR GD_BZIP2_ENCODED ,
+.BR GD_GZIP_ENCODED ,
+.BR GD_LZMA_ENCODED ,
+.BR GD_SIE_ENCODED ,
+.BR GD_SLIM_ENCODED ,
+.BR GD_TEXT_ENCODED ,
+.BR GD_ZZIP_ENCODED ,
+.BR GD_ZZSLIM_ENCODED ,
.BR GD_ENC_UNSUPPORTED .
.ad n
.hy
.PP
-See
-.BR gd_cbopen (3)
-and dirfile-encoding(5) for the meanings of these symbols and details on the
-supported encoding schemes. If the encoding scheme specified in the dirfile
+If the encoding scheme specified in the dirfile
metadata is unknown to GetData,
.B GD_ENC_UNSUPPORTED
-will be returned.
+will be returned. See
+.BR gd_cbopen (3)
+and dirfile-encoding(5) for the meanings of the other symbols and details on the
+supported encoding schemes.
.PP
On error, it returns zero and sets the dirfile error to a non-zero error value.
Possible error values are:
Modified: trunk/getdata/man/gd_entry.3
===================================================================
--- trunk/getdata/man/gd_entry.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_entry.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -1,6 +1,6 @@
.\" gd_entry.3. The gd_entry man page.
.\"
-.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 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_entry 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_entry 3 "21 April 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_entry \(em retrieve a dirfile field's metadata
.SH SYNOPSIS
@@ -134,17 +134,29 @@
.IP
.nh
.ad l
-.BR GD_BIT_ENTRY ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY ,
-.BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY ,
-.BR GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
-.BR GD_RAW_ENTRY ", " GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.BR GD_BIT_ENTRY ,
+.BR GD_CARRAY_ENTRY ,
+.BR GD_CONST_ENTRY ,
+.BR GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ,
+.BR GD_LINCOM_ENTRY ,
+.BR GD_LINTERP_ENTRY ,
+.BR GD_MPLEX_ENTRY ,
+.BR GD_MULTIPLY_ENTRY ,
+.BR GD_PHASE_ENTRY ,
+.BR GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ,
+.BR GD_RECIP_ENTRY ,
+.BR GD_SBIT_ENTRY ,
+.BR GD_STRING_ENTRY ,
+.BR GD_WINDOW_ENTRY .
.ad n
.hy
.PP
.B GD_INDEX_ENTRY
is a special field type used only for the implicit
.I INDEX
-field. The meaning of the other symbols should be self-explanatory.
+field. The other entry types are explained in detail in dirfile-format(5).
.PP
The
.I fragment_index
Modified: trunk/getdata/man/gd_entry_list.3
===================================================================
--- trunk/getdata/man/gd_entry_list.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_entry_list.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -101,8 +101,8 @@
.BR gd_close (3)
and should not be de-allocated by the caller. The list returned should not be
assumed to be in any particular order. The array is terminated by a NULL
-pointer. The number of strings in the array can be obtained from an equivalent
-call to
+pointer. The number of elements in the array, excluding the terminating NULL,
+can be obtained from an equivalent call to
.BR gd_nentries (3).
The caller may not modify any strings in the array, or the array itself. Doing
@@ -119,6 +119,7 @@
.RS
.BI gd_field_list( dirfile );
.RE
+.PP
is equivalent to
.RS
.BI gd_entry_list( dirfile ", NULL, GD_ALL_ENTRIES, 0);
@@ -128,6 +129,7 @@
.RS
.BI gd_field_list_by_type( dirfile ", " type );
.RE
+.PP
is equivalent to
.RS
.BI gd_entry_list( dirfile ", NULL, " type ", 0);"
@@ -137,6 +139,7 @@
.RS
.BI gd_mfield_list( dirfile ", " parent );
.RE
+.PP
is equivalent to
.RS
.BI gd_entry_list( dirfile ", " parent ", GD_ALL_ENTRIES, 0);"
@@ -146,6 +149,7 @@
.RS
.BI gd_mfield_list_by_type( dirfile ", " parent ", " type );
.RE
+.PP
is equivalent to
.RS
.BI gd_entry_list( dirfile ", " parent ", " type ", 0);"
@@ -155,6 +159,7 @@
.RS
.BI gd_mvector_list( dirfile ", " parent );
.RE
+.PP
is equivalent to
.RS
.BI gd_entry_list( dirfile ", " parent ", GD_VECTOR_ENTRIES, 0);"
@@ -164,6 +169,7 @@
.RS
.BI gd_vector_list( dirfile );
.RE
+.PP
is equivalent to
.RS
.BI gd_entry_list( dirfile ", NULL, GD_VECTOR_ENTRIES, 0);"
Modified: trunk/getdata/man/gd_entry_type.3
===================================================================
--- trunk/getdata/man/gd_entry_type.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_entry_type.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -1,6 +1,6 @@
.\" gd_entry_type.3. The gd_entry_type man page.
.\"
-.\" Copyright (C) 2008, 2009, 2010, 2011 D. V. Wiebe
+.\" Copyright (C) 2008, 2009, 2010, 2011, 2012 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_entry_type 3 "18 August 2011" "Version 0.8.0" "GETDATA"
+.TH gd_entry_type 3 "21 August 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_entry_type \(em retrieve the type of a dirfile field
.SH SYNOPSIS
@@ -42,10 +42,22 @@
.IP
.nh
.ad l
-.BR GD_BIT_ENTRY ", " GD_CARRAY_ENTRY ", " GD_CONST_ENTRY ", " GD_DIVIDE_ENTRY ,
-.BR GD_INDEX_ENTRY ", " GD_LINCOM_ENTRY ", " GD_LINTERP_ENTRY ,
-.BR GD_MULTIPLY_ENTRY ", " GD_PHASE_ENTRY ", " GD_POLYNOM_ENTRY ,
-.BR GD_RAW_ENTRY ", " GD_RECIP_ENTRY ", " GD_SBIT_ENTRY ", " GD_STRING_ENTRY .
+.BR GD_BIT_ENTRY ,
+.BR GD_CARRAY_ENTRY ,
+.BR GD_CONST_ENTRY ,
+.BR GD_DIVIDE_ENTRY ,
+.BR GD_INDEX_ENTRY ,
+.BR GD_LINCOM_ENTRY ,
+.BR GD_LINTERP_ENTRY ,
+.BR GD_MPLEX_ENTRY ,
+.BR GD_MULTIPLY_ENTRY ,
+.BR GD_PHASE_ENTRY ,
+.BR GD_POLYNOM_ENTRY ,
+.BR GD_RAW_ENTRY ,
+.BR GD_RECIP_ENTRY ,
+.BR GD_SBIT_ENTRY ,
+.BR GD_STRING_ENTRY ,
+.BR GD_WINDOW_ENTRY .
.ad n
.hy
.SH RETURN VALUE
Modified: trunk/getdata/man/gd_error_count.3
===================================================================
--- trunk/getdata/man/gd_error_count.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_error_count.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -1,4 +1,4 @@
-\" gd_error_count.3. The gd_error_count man page.
+.\" gd_error_count.3. The gd_error_count man page.
.\"
.\" Copyright (C) 2011 D. V. Wiebe
.\"
Modified: trunk/getdata/man/gd_get_carray_slice.3
===================================================================
--- trunk/getdata/man/gd_get_carray_slice.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_get_carray_slice.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -78,43 +78,43 @@
return type of the data:
.RS
.TP 11
-.I GD_UINT8
+.B GD_UINT8
unsigned 8-bit integer
.TP
-.I GD_INT8
+.B GD_INT8
signed (two's complement) 8-bit integer
.TP
-.I GD_UINT16
+.B GD_UINT16
unsigned 16-bit integer
.TP
-.I GD_INT16
+.B GD_INT16
signed (two's complement) 16-bit integer
.TP
-.I GD_UINT32
+.B GD_UINT32
unsigned 32-bit integer
.TP
-.I GD_INT32
+.B GD_INT32
signed (two's complement) 32-bit integer
.TP
-.I GD_UINT64
+.B GD_UINT64
unsigned 64-bit integer
.TP
-.I GD_INT64
+.B GD_INT64
signed (two's complement) 64-bit integer
.TP
-.IR GD_FLOAT32
+.B GD_FLOAT32
IEEE-754 standard 32-bit single precision floating point number
.TP
-.IR GD_FLOAT64
+.B GD_FLOAT64
IEEE-754 standard 64-bit double precision floating point number
.TP
-.IR GD_COMPLEX64
+.B GD_COMPLEX64
C99-conformant 64-bit single precision complex number
.TP
-.IR GD_COMPLEX128
+.B GD_COMPLEX128
C99-conformant 128-bit double precision complex number
.TP
-.I GD_NULL
+.B GD_NULL
the null type: the database is queried as usual, but no data is returned.
In this case,
.I data_out
Modified: trunk/getdata/man/gd_get_constant.3
===================================================================
--- trunk/getdata/man/gd_get_constant.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_get_constant.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -55,43 +55,43 @@
return type of the data:
.RS
.TP 11
-.I GD_UINT8
+.B GD_UINT8
unsigned 8-bit integer
.TP
-.I GD_INT8
+.B GD_INT8
signed (two's complement) 8-bit integer
.TP
-.I GD_UINT16
+.B GD_UINT16
unsigned 16-bit integer
.TP
-.I GD_INT16
+.B GD_INT16
signed (two's complement) 16-bit integer
.TP
-.I GD_UINT32
+.B GD_UINT32
unsigned 32-bit integer
.TP
-.I GD_INT32
+.B GD_INT32
signed (two's complement) 32-bit integer
.TP
-.I GD_UINT64
+.B GD_UINT64
unsigned 64-bit integer
.TP
-.I GD_INT64
+.B GD_INT64
signed (two's complement) 64-bit integer
.TP
-.IR GD_FLOAT32
+.B GD_FLOAT32
IEEE-754 standard 32-bit single precision floating point number
.TP
-.IR GD_FLOAT64
+.B GD_FLOAT64
IEEE-754 standard 64-bit double precision floating point number
.TP
-.IR GD_COMPLEX64
+.B GD_COMPLEX64
C99-conformant 64-bit single precision complex number
.TP
-.IR GD_COMPLEX128
+.B GD_COMPLEX128
C99-conformant 128-bit double precision complex number
.TP
-.I GD_NULL
+.B GD_NULL
the null type: the database is queried as usual, but no data is returned.
In this case,
.I data_out
Modified: trunk/getdata/man/gd_getdata.3
===================================================================
--- trunk/getdata/man/gd_getdata.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_getdata.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -103,43 +103,43 @@
return type of the data:
.RS
.TP 11
-.I GD_UINT8
+.B GD_UINT8
unsigned 8-bit integer
.TP
-.I GD_INT8
+.B GD_INT8
signed (two's complement) 8-bit integer
.TP
-.I GD_UINT16
+.B GD_UINT16
unsigned 16-bit integer
.TP
-.I GD_INT16
+.B GD_INT16
signed (two's complement) 16-bit integer
.TP
-.I GD_UINT32
+.B GD_UINT32
unsigned 32-bit integer
.TP
-.I GD_INT32
+.B GD_INT32
signed (two's complement) 32-bit integer
.TP
-.I GD_UINT64
+.B GD_UINT64
unsigned 64-bit integer
.TP
-.I GD_INT64
+.B GD_INT64
signed (two's complement) 64-bit integer
.TP
-.IR GD_FLOAT32
+.B GD_FLOAT32
IEEE-754 standard 32-bit single precision floating point number
.TP
-.IR GD_FLOAT64
+.B GD_FLOAT64
IEEE-754 standard 64-bit double precision floating point number
.TP
-.IR GD_COMPLEX64
+.B GD_COMPLEX64
C99-conformant 64-bit single precision complex number
.TP
-.IR GD_COMPLEX128
+.B GD_COMPLEX128
C99-conformant 128-bit double precision complex number
.TP
-.I GD_NULL
+.B GD_NULL
the null type: the database is queried as usual, but no data is returned.
In this case,
.I data_out
Modified: trunk/getdata/man/gd_include_affix.3
===================================================================
--- trunk/getdata/man/gd_include_affix.3 2012-04-20 01:05:08 UTC (rev 704)
+++ trunk/getdata/man/gd_include_affix.3 2012-04-21 02:52:38 UTC (rev 705)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_include_affix 3 "4 April 2012" "Version 0.8.0" "GETDATA"
+.TH gd_include_affix 3 "21 April 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_include_affix, gd_include \(em add a format specification fragment to a
dirfile
@@ -71,19 +71,51 @@
The
.I flags
-argument should be a bitwise-or'd collection of the following flags, or zero
-if no flags are desired:
+argument should be a bitwise-or'd collection of zero or more of the following
+flags:
+.PP
+.PD 0
+.B GD_ARM_ENDIAN
.TP
+.PD
+.B GD_NOT_ARM_ENDIAN
+Specifies that double precision floating point raw data on disk are, or are not,
+stored in the middle-endian format used by older ARM processors.
+
+These flag only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
+.B GD_FORCE_ENDIAN
+is also specified.
+
+On every platform, one of these flags
+.RB ( GD_NOT_ARM_ENDIAN
+on all but middle-ended ARM systems)
+indicates the native behaviour of the platform. That symbol will equal zero,
+and may be omitted.
+.PP
+.PD 0
.B GD_BIG_ENDIAN
-Specifies that raw data on disk is stored as big-endian data (most significant
-byte first). Specifying this flag along with the contradictory
-.BR GD_LITTLE_ENDIAN
-will cause the library to assume that the endianness of the data is opposite to
-that of the native architecture.
+.TP
+.PD
+.B GD_LITTLE_ENDIAN
+Specifies the default byte sex of raw data stored on disk to be either
+big-endian (most significant byte first) or little-endian (least significant
+byte first). Omitting both flags indicates the default should be the native
+endianness of the platform.
-This flag is ignored completely if an
-.B ENDIAN
-directive occurs in the fragment, unless
+Unlike the ARM endianness flags above, neither of these symbols is ever zero.
+Specifying both these flags together will cause the library to assume that the
+endianness of the data is opposite to that of the native architecture, whatever
+that might be.
+
+These flag only set the default endianness, and will be overridden when an
+.B /ENDIAN
+directive specifies the byte sex of
+.B RAW
+fields, unless
.B GD_FORCE_ENDIAN
is also specified.
.TP
@@ -99,16 +131,17 @@
.BR GD_CREAT ,
the call will fail if the file specified by
.I include_file
-already exists. Behaviour of this flag is undefined if
+already exists. If
.B GD_CREAT
-is not specified. This flag suffers from all the limitations of the
+is not specified, this flag is ignord. This flag suffers from all the
+limitations of the
.B O_EXCL
flag as indicated in
.BR open (2).
.TP
.B GD_FORCE_ENCODING
Specifies that
-.B ENCODING
+.B /ENCODING
directives (see
.BR dirfile-format (5))
found in the fragment should be ignored. The encoding scheme
@@ -118,7 +151,7 @@
.TP
.B GD_FORCE_ENDIAN
Specifies that
-.B ENDIAN
+.B /ENDIAN
directives (see
.BR dirfile-format (5))
found in the fragment should be ignored. When specified with one of
@@ -154,19 +187,6 @@
directive in the included fragment will replace the current reference field in
the dirfile.
.TP
-.B GD_LITTLE_ENDIAN
-Specifies that raw data on disk is stored as little-endian data (least
-significant byte first). Specifying this flag along with the contradictory
-.BR GD_BIG_ENDIAN
-will cause the library to assume that the endianness of the data is opposite to
-that of the native architecture.
-
-This flag is ignored completely if an
-.B ENDIAN
-directive occurs in the fragment, unless
-.B GD_FORCE_ENDIAN
-is also specified.
-.TP
.B GD_PEDANTIC
Specifies that unrecognised lines found during the parsing of the fragment
should always cause a fatal error. Without this flag, if a
@@ -193,9 +213,8 @@
.B GD_FORCE_ENCODED
i...
[truncated message content] |
|
From: <ket...@us...> - 2012-05-03 19:47:43
|
Revision: 707
http://getdata.svn.sourceforge.net/getdata/?rev=707&view=rev
Author: ketiltrout
Date: 2012-05-03 19:47:36 +0000 (Thu, 03 May 2012)
Log Message:
-----------
rc1.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
trunk/getdata/m4/version.m4
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-04-21 04:32:53 UTC (rev 706)
+++ trunk/getdata/ChangeLog 2012-05-03 19:47:36 UTC (rev 707)
@@ -1,3 +1,9 @@
+2012-04-21 D. V. Wiebe <ge...@ke...> svn:706
+ GetData-0.8.0rc1:
+
+ * bindings/cxx/test/big_test.cpp bindings/perl/test/big_test.t: Fix
+ mplex_lookback checks.
+
2012-04-21 D. V. Wiebe <ge...@ke...> svn:705
* man/make_html.pl: Improvements.
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2012-04-21 04:32:53 UTC (rev 706)
+++ trunk/getdata/NEWS 2012-05-03 19:47:36 UTC (rev 707)
@@ -1,4 +1,4 @@
-New in version 0.8.0a:
+New in version 0.8.0rc1:
Dirfile Changes
Modified: trunk/getdata/m4/version.m4
===================================================================
--- trunk/getdata/m4/version.m4 2012-04-21 04:32:53 UTC (rev 706)
+++ trunk/getdata/m4/version.m4 2012-05-03 19:47:36 UTC (rev 707)
@@ -21,22 +21,22 @@
m4_define(getdata_major, 0)
m4_define(getdata_minor, 8)
m4_define(getdata_revision, 0)
-m4_define(getdata_extra, [a])
+m4_define(getdata_extra, [rc1])
m4_define(getdata_version,
getdata_major.getdata_minor.getdata_revision[]getdata_extra)
dnl libgetdata current interface version
-m4_define(getdata_iface_version, 4)
+m4_define(getdata_iface_version, 5)
dnl libgetdata current interface implementation revision
-m4_define(getdata_impl_revision, 3)
+m4_define(getdata_impl_revision, 0)
dnl libgetdata interface age (current interface - oldest supported interface)
m4_define(getdata_iface_age, 0)
dnl libgetdata++ interface version info
-m4_define(getdataxx_version, 2:0:0)
+m4_define(getdataxx_version, 3:0:0)
dnl libfgetdata interface version info
-m4_define(fgetdata_version, 2:1:0)
+m4_define(fgetdata_version, 3:0:1)
dnl libf95getdata interface version info
-m4_define(f95getdata_version, 2:0:0)
+m4_define(f95getdata_version, 3:0:1)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-05-03 20:47:41
|
Revision: 708
http://getdata.svn.sourceforge.net/getdata/?rev=708&view=rev
Author: ketiltrout
Date: 2012-05-03 20:47:35 +0000 (Thu, 03 May 2012)
Log Message:
-----------
MSVC fixes.
Modified Paths:
--------------
trunk/getdata/cmake/CMakeLists.txt
trunk/getdata/src/field_list.c
trunk/getdata/src/internal.h
trunk/getdata/src/open.c
trunk/getdata/src/parse.c
trunk/getdata/src/sie.c
Modified: trunk/getdata/cmake/CMakeLists.txt
===================================================================
--- trunk/getdata/cmake/CMakeLists.txt 2012-05-03 19:47:36 UTC (rev 707)
+++ trunk/getdata/cmake/CMakeLists.txt 2012-05-03 20:47:35 UTC (rev 708)
@@ -44,7 +44,7 @@
set(DEFINE_GD_NO_C99_API "#define GD_NO_C99_API")
set(DEFINE_gd_int64_t "#define gd_int64_t __int64")
- set(DEFINE_gd_uint64_t "#define gd_uint64_t __uint64")
+ set(DEFINE_gd_uint64_t "#define gd_uint64_t unsigned __int64")
add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
add_definitions(
@@ -52,17 +52,23 @@
-D_USE_MATH_DEFINES
-DHAVE_DIRENT_H
-DHAVE_DIRECT_H
+ -DHAVE_FCNTL_H
-DHAVE_LIBGEN_H
-DSTDC_HEADERS
-DHAVE_INTTYPES_H
-DHAVE_IO_H
-DHAVE_STDINT_H
+ -DHAVE_SYS_STAT_H
-DHAVE__STAT64
-DHAVE_STRUCT__STAT64
-DHAVE__COMMIT
-DHAVE__STRTOI64
-DHAVE__STRTOUI64
-DHAVE__GETCWD
+ -DGD_DIRSEP='\\\\'
+ -Drestrict=
+ -DSIZEOF_INT=4
+ -DSIZEOF_UNSIGNED_INT=4
)
set(CMAKE_DEBUG_POSTFIX d)
Modified: trunk/getdata/src/field_list.c
===================================================================
--- trunk/getdata/src/field_list.c 2012-05-03 19:47:36 UTC (rev 707)
+++ trunk/getdata/src/field_list.c 2012-05-03 20:47:35 UTC (rev 708)
@@ -117,11 +117,11 @@
/* aliases */
if (E->field_type == GD_ALIAS_ENTRY) {
+ int ret = 0;
if (noalias) {
dreturn("%i (alias)", 0);
return 0;
}
- int ret = 0;
if (E->e->entry[0])
ret = _GD_ListEntry(E->e->entry[0], meta, hidden, 0, special, type);
dreturn("%i", ret);
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-05-03 19:47:36 UTC (rev 707)
+++ trunk/getdata/src/internal.h 2012-05-03 20:47:35 UTC (rev 708)
@@ -116,6 +116,12 @@
/* the open() in the MSVCRT doesn't permit open()ing directories */
#ifdef __MSVCRT__
#define GD_NO_DIR_OPEN
+/* rename open() flags */
+#define O_RDWR _O_RDWR
+#define O_RDONLY _O_RDONLY
+#define O_CREAT _O_CREAT
+#define O_EXCL _O_EXCL
+#define O_TRUNC _O_TRUNC
#endif
#ifdef GD_NO_C99_API
@@ -374,7 +380,7 @@
#endif
#if !defined(HAVE_DECL_OFFSETOF) || ! HAVE_DECL_OFFSETOF
-#define offsetof(t,m) ((size_t)((char*)&(((t)*)0)->(m) - (char*)0))
+#define offsetof(t,m) ((size_t)(((char*)&((t*)0)->m) - (char*)0))
#endif
#ifdef HAVE_READDIR_R
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2012-05-03 19:47:36 UTC (rev 707)
+++ trunk/getdata/src/open.c 2012-05-03 20:47:35 UTC (rev 708)
@@ -116,9 +116,15 @@
/* check file type */
switch (statbuf.st_mode & S_IFMT) {
case S_IFREG:
+#ifdef S_IFBLK
case S_IFBLK:
+#endif
+#ifdef S_IFIFO
case S_IFIFO:
+#endif
+#ifdef S_IFCHR
case S_IFCHR:
+#endif
#ifdef S_IFLNK
case S_IFLNK:
#endif
Modified: trunk/getdata/src/parse.c
===================================================================
--- trunk/getdata/src/parse.c 2012-05-03 19:47:36 UTC (rev 707)
+++ trunk/getdata/src/parse.c 2012-05-03 20:47:35 UTC (rev 708)
@@ -2099,13 +2099,14 @@
break;
case 'I':
if (strcmp(ptr, "INCLUDE") == 0 && (!pedantic || *standards >= 3)) {
- matched = 1;
+ int frag;
unsigned long subflags = D->fragment[me].encoding
| D->fragment[me].byte_sex | (*flags & (GD_PEDANTIC | GD_PERMISSIVE
| GD_FORCE_ENDIAN | GD_FORCE_ENCODING | GD_IGNORE_DUPS
| GD_IGNORE_REFS));
+ matched = 1;
- int frag = _GD_Include(D, in_cols[1], D->fragment[me].cname, linenum,
+ frag = _GD_Include(D, in_cols[1], D->fragment[me].cname, linenum,
ref_name, me, (n_cols > 2) ? in_cols[2] : NULL,
(n_cols > 3) ? in_cols[3] : NULL, standards, &subflags, 0);
Modified: trunk/getdata/src/sie.c
===================================================================
--- trunk/getdata/src/sie.c 2012-05-03 19:47:36 UTC (rev 707)
+++ trunk/getdata/src/sie.c 2012-05-03 20:47:35 UTC (rev 708)
@@ -334,8 +334,9 @@
for (i = 0; i < nelem; ++i) {
if (memcmp(((const char*)ptr) + i * dlen, cur_datum, dlen)) {
if (++rin == plen) {
+ void *p2;
plen += 10;
- void *p2 = realloc(p, plen * size);
+ p2 = realloc(p, plen * size);
if (p2 == NULL) {
free(p);
dreturn("%i", -1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-05-23 06:57:19
|
Revision: 709
http://getdata.svn.sourceforge.net/getdata/?rev=709&view=rev
Author: ketiltrout
Date: 2012-05-23 06:57:07 +0000 (Wed, 23 May 2012)
Log Message:
-----------
Fixes for MSVC. Also added checkdirfile, the C++ test suite, and verbose
debugging to the CMake rules.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/Makefile.am
trunk/getdata/README.win
trunk/getdata/bindings/cxx/getdata/dirfile.h
trunk/getdata/bindings/cxx/getdata/entry.h
trunk/getdata/bindings/cxx/getdata/fragment.h
trunk/getdata/bindings/cxx/test/big_test.cpp
trunk/getdata/cmake/CMakeLists.txt
trunk/getdata/cmake/bindings/cxx/CMakeLists.txt
trunk/getdata/cmake/src/CMakeLists.txt
trunk/getdata/cmake/test/CMakeLists.txt
trunk/getdata/configure.ac
trunk/getdata/src/add.c
trunk/getdata/src/ascii.c
trunk/getdata/src/bzip.c
trunk/getdata/src/common.c
trunk/getdata/src/compat.c
trunk/getdata/src/constant.c
trunk/getdata/src/encoding.c
trunk/getdata/src/endian.c
trunk/getdata/src/errors.c
trunk/getdata/src/field_list.c
trunk/getdata/src/flush.c
trunk/getdata/src/getdata.c
trunk/getdata/src/gzip.c
trunk/getdata/src/internal.h
trunk/getdata/src/lzma.c
trunk/getdata/src/mod.c
trunk/getdata/src/name.c
trunk/getdata/src/nan.h
trunk/getdata/src/parse.c
trunk/getdata/src/putdata.c
trunk/getdata/src/raw.c
trunk/getdata/src/sie.c
trunk/getdata/src/slim.c
trunk/getdata/src/string.c
trunk/getdata/src/types.c
trunk/getdata/src/zzip.c
trunk/getdata/src/zzslim.c
trunk/getdata/test/add_meta.c
trunk/getdata/test/add_meta_alias.c
trunk/getdata/test/include_cb.c
trunk/getdata/test/include_pc.c
trunk/getdata/test/madd_affix.c
trunk/getdata/test/madd_window.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/parse_mplex_nomax.c
trunk/getdata/test/slim_nframes.c
trunk/getdata/test/test.h
trunk/getdata/util/checkdirfile.c
Added Paths:
-----------
trunk/getdata/cmake/bindings/cxx/test/
trunk/getdata/cmake/bindings/cxx/test/CMakeLists.txt
trunk/getdata/cmake/util/
trunk/getdata/cmake/util/CMakeLists.txt
Property Changed:
----------------
trunk/getdata/README.win
trunk/getdata/bindings/cxx/getdata/mplexentry.h
trunk/getdata/bindings/cxx/getdata/windowentry.h
trunk/getdata/bindings/cxx/internal.h
trunk/getdata/bindings/cxx/mplexentry.cpp
trunk/getdata/bindings/cxx/windowentry.cpp
trunk/getdata/bindings/f77/test/test_getdata.f.in
trunk/getdata/bindings/idl/package/Makefile.am
trunk/getdata/bindings/idl/package/README
trunk/getdata/bindings/idl/package/configure.ac
trunk/getdata/bindings/perl/Build.PL.in
trunk/getdata/bindings/perl/GetData.pm.in
trunk/getdata/bindings/perl/GetData.xs
trunk/getdata/bindings/perl/MANIFEST.in
trunk/getdata/bindings/perl/Makefile.am
trunk/getdata/bindings/perl/funclist.pl
trunk/getdata/bindings/perl/simple_funcs.pl
trunk/getdata/bindings/perl/simple_funcs.xsin
trunk/getdata/bindings/perl/test/big_test.t
trunk/getdata/bindings/perl/test/callback.t
trunk/getdata/bindings/perl/typemap
trunk/getdata/doc/README.perl
trunk/getdata/m4/perl.m4
trunk/getdata/man/gd_add_alias.3
trunk/getdata/man/gd_alias_target.3
trunk/getdata/man/gd_aliases.3
trunk/getdata/man/gd_alter_affixes.3
trunk/getdata/man/gd_desync.3
trunk/getdata/man/gd_entry_list.3
trunk/getdata/man/gd_error_count.3
trunk/getdata/man/gd_flags.3
trunk/getdata/man/gd_fragment_affixes.3
trunk/getdata/man/gd_hidden.3
trunk/getdata/man/gd_hide.3
trunk/getdata/man/gd_mplex_lookback.3
trunk/getdata/man/gd_naliases.3
trunk/getdata/man/gd_nentries.3
trunk/getdata/man/gd_seek.3
trunk/getdata/man/gd_tell.3
trunk/getdata/man/gd_verbose_prefix.3
trunk/getdata/man/make_html.pl
trunk/getdata/src/fpos.c
trunk/getdata/src/sie.c
trunk/getdata/src/zzip.c
trunk/getdata/src/zzslim.c
trunk/getdata/test/add_affix.c
trunk/getdata/test/add_alias.c
trunk/getdata/test/add_alias_meta.c
trunk/getdata/test/add_meta.c
trunk/getdata/test/add_meta_alias.c
trunk/getdata/test/add_mplex.c
trunk/getdata/test/add_mplex_val.c
trunk/getdata/test/add_raw_include.c
trunk/getdata/test/add_resolv.c
trunk/getdata/test/add_scalar_carray.c
trunk/getdata/test/add_spec_resolv.c
trunk/getdata/test/add_string_affix.c
trunk/getdata/test/add_window.c
trunk/getdata/test/add_window_op.c
trunk/getdata/test/alias_list.c
trunk/getdata/test/alias_list_alias.c
trunk/getdata/test/alias_list_missing.c
trunk/getdata/test/alias_num.c
trunk/getdata/test/alias_num_alias.c
trunk/getdata/test/alias_num_missing.c
trunk/getdata/test/alias_target.c
trunk/getdata/test/alias_target_alias.c
trunk/getdata/test/alias_target_missing.c
trunk/getdata/test/alter_crecip_zero.c
trunk/getdata/test/alter_entry_affix.c
trunk/getdata/test/alter_entry_hidden.c
trunk/getdata/test/alter_mplex.c
trunk/getdata/test/alter_mspec_affix.c
trunk/getdata/test/alter_recip_zero.c
trunk/getdata/test/alter_spec_affix.c
trunk/getdata/test/alter_window.c
trunk/getdata/test/ascii_add.c
trunk/getdata/test/cvlist_array_hidden.c
trunk/getdata/test/cvlist_array_meta_hidden.c
trunk/getdata/test/cvlist_hidden.c
trunk/getdata/test/cvlist_meta_hidden.c
trunk/getdata/test/del_derived_after.c
trunk/getdata/test/desync.c
trunk/getdata/test/desync_flush.c
trunk/getdata/test/desync_reopen.c
trunk/getdata/test/desync_reopen_inv.c
trunk/getdata/test/elist_alias.c
trunk/getdata/test/elist_hidden.c
trunk/getdata/test/elist_scalar.c
trunk/getdata/test/endian_alter_sie.c
trunk/getdata/test/entry_divide.c
trunk/getdata/test/entry_mplex.c
trunk/getdata/test/entry_mplex_scalar.c
trunk/getdata/test/entry_recip.c
trunk/getdata/test/entry_type_alias.c
trunk/getdata/test/entry_window.c
trunk/getdata/test/entry_window_scalar.c
trunk/getdata/test/error_num.c
trunk/getdata/test/error_verbose.c
trunk/getdata/test/error_verbose_prefix.c
trunk/getdata/test/flist_hidden.c
trunk/getdata/test/flist_meta_hidden.c
trunk/getdata/test/flist_type_hidden.c
trunk/getdata/test/flist_type_meta_hidden.c
trunk/getdata/test/fragment_affix.c
trunk/getdata/test/fragment_affix_alter.c
trunk/getdata/test/fragment_affix_alter2.c
trunk/getdata/test/fragment_affix_dup.c
trunk/getdata/test/fragment_index_alias.c
trunk/getdata/test/get_here.c
trunk/getdata/test/get_here_foffs.c
trunk/getdata/test/get_heres.c
trunk/getdata/test/get_lincom_null.c
trunk/getdata/test/get_lincom_spf.c
trunk/getdata/test/get_mplex.c
trunk/getdata/test/get_mplex_lb.c
trunk/getdata/test/get_mplex_lball.c
trunk/getdata/test/get_mplex_nolb.c
trunk/getdata/test/get_phase_affix.c
trunk/getdata/test/get_rofs.c
trunk/getdata/test/get_window.c
trunk/getdata/test/get_window_clr.c
trunk/getdata/test/get_window_ge.c
trunk/getdata/test/get_window_gt.c
trunk/getdata/test/get_window_le.c
trunk/getdata/test/get_window_lt.c
trunk/getdata/test/get_window_ne.c
trunk/getdata/test/get_window_set.c
trunk/getdata/test/global_flags.c
trunk/getdata/test/gzip_add.c
trunk/getdata/test/gzip_get_put.c
trunk/getdata/test/gzip_move_to.c
trunk/getdata/test/gzip_put_get.c
trunk/getdata/test/hide.c
trunk/getdata/test/hide_hidden.c
trunk/getdata/test/hide_unhide.c
trunk/getdata/test/include_affix.c
trunk/getdata/test/madd_affix.c
trunk/getdata/test/madd_alias.c
trunk/getdata/test/madd_index.c
trunk/getdata/test/madd_mplex.c
trunk/getdata/test/madd_spec_resolv.c
trunk/getdata/test/madd_window.c
trunk/getdata/test/move_affix.c
trunk/getdata/test/move_affix_dup.c
trunk/getdata/test/move_alias.c
trunk/getdata/test/name_affix.c
trunk/getdata/test/name_affix_bad.c
trunk/getdata/test/name_after.c
trunk/getdata/test/name_after_const.c
trunk/getdata/test/name_dup.c
trunk/getdata/test/name_update.c
trunk/getdata/test/name_update_const.c
trunk/getdata/test/nentries_alias.c
trunk/getdata/test/nentries_hidden.c
trunk/getdata/test/nentries_scalar.c
trunk/getdata/test/nfields_hidden.c
trunk/getdata/test/nfields_type_hidden.c
trunk/getdata/test/nfields_vector_hidden.c
trunk/getdata/test/nmeta_hidden.c
trunk/getdata/test/nmeta_type_hidden.c
trunk/getdata/test/nmeta_vectors_hidden.c
trunk/getdata/test/open_abs.c
trunk/getdata/test/parse_alias.c
trunk/getdata/test/parse_alias_code.c
trunk/getdata/test/parse_alias_dup.c
trunk/getdata/test/parse_alias_meta.c
trunk/getdata/test/parse_alias_missing.c
trunk/getdata/test/parse_hidden.c
trunk/getdata/test/parse_hidden_field.c
trunk/getdata/test/parse_hidden_meta.c
trunk/getdata/test/parse_include_absolute.c
trunk/getdata/test/parse_include_absrel.c
trunk/getdata/test/parse_include_loop.c
trunk/getdata/test/parse_include_prefix.c
trunk/getdata/test/parse_include_prefix_dup.c
trunk/getdata/test/parse_include_preprefix.c
trunk/getdata/test/parse_include_relabs.c
trunk/getdata/test/parse_include_relrel.c
trunk/getdata/test/parse_include_suffix.c
trunk/getdata/test/parse_include_sufsuffix.c
trunk/getdata/test/parse_malias.c
trunk/getdata/test/parse_malias_dup.c
trunk/getdata/test/parse_malias_meta.c
trunk/getdata/test/parse_meta_affix.c
trunk/getdata/test/parse_meta_alias.c
trunk/getdata/test/parse_meta_implicit_affix.c
trunk/getdata/test/parse_meta_jump.c
trunk/getdata/test/parse_meta_malias.c
trunk/getdata/test/parse_meta_meta.c
trunk/getdata/test/parse_mplex.c
trunk/getdata/test/parse_mplex_ncols.c
trunk/getdata/test/parse_mplex_nomax.c
trunk/getdata/test/parse_mplex_scalar.c
trunk/getdata/test/parse_version_89.c
trunk/getdata/test/parse_version_98.c
trunk/getdata/test/parse_version_p8.c
trunk/getdata/test/parse_version_p9.c
trunk/getdata/test/parse_window.c
trunk/getdata/test/parse_window_ncols.c
trunk/getdata/test/parse_window_op.c
trunk/getdata/test/parse_window_scalar.c
trunk/getdata/test/put_here.c
trunk/getdata/test/put_heres.c
trunk/getdata/test/put_mplex.c
trunk/getdata/test/put_window.c
trunk/getdata/test/put_zero.c
trunk/getdata/test/seek64.c
trunk/getdata/test/seek_cur.c
trunk/getdata/test/seek_end.c
trunk/getdata/test/seek_foffs.c
trunk/getdata/test/seek_set.c
trunk/getdata/test/sie_get_big.c
trunk/getdata/test/sie_get_little.c
trunk/getdata/test/sie_move_from.c
trunk/getdata/test/sie_move_to.c
trunk/getdata/test/sie_nframes_big.c
trunk/getdata/test/sie_nframes_little.c
trunk/getdata/test/sie_put_big.c
trunk/getdata/test/sie_put_little.c
trunk/getdata/test/spf_alias.c
trunk/getdata/test/spf_alias_meta.c
trunk/getdata/test/spf_alias_missing.c
trunk/getdata/test/svlist_hidden.c
trunk/getdata/test/svlist_meta_hidden.c
trunk/getdata/test/tell.c
trunk/getdata/test/tell64.c
trunk/getdata/test/trunc_dir.c
trunk/getdata/test/trunc_truncsub.c
trunk/getdata/test/version_9.c
trunk/getdata/test/version_9_strict.c
trunk/getdata/test/version_9_write.c
trunk/getdata/test/vlist_alias.c
trunk/getdata/test/vlist_hidden.c
trunk/getdata/test/vlist_meta_hidden.c
trunk/getdata/test/zzip_data.c
trunk/getdata/test/zzip_get.c
trunk/getdata/test/zzip_get_get.c
trunk/getdata/test/zzip_nframes.c
trunk/getdata/test/zzslim_get.c
trunk/getdata/test/zzslim_nframes.c
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/ChangeLog 2012-05-23 06:57:07 UTC (rev 709)
@@ -1,3 +1,34 @@
+2012-05-22 D. V. Wiebe <ge...@ke...> svn:706
+ * cmake/CMakeLists.txt: Update definitons. Support GD_UTIL.
+ * cmake/test/CMakeLists.txt: Update the list of excluded tests.
+ * cmake/src/CMakeLists.txt: Support GD_DEBUG and conditionally build debug.c.
+ * cmake/bindings/cxx/CMakeLists.txt: Support GD_TEST.
+ * cmake/util/CMakeLists.txt cmake/bindings/cxx/test/CMakeLists.txt: Added.
+
+ * src/internal.h: Define PRNsize_t and PRNssize_t to get around printf()s
+ which don't recognise the "z" length modifier. Changed everywhere. Handle
+ basename, offsetof, strtod.
+
+ * src/compat.c (basename gd_strtod): Added.
+ * src/parse.c (_GD_SetScalar) src/nan.h: Call gd_strtod.
+
+ * README.win: Update.
+
+ * bindings/cxx/test/big_test.cpp: Tweak includes to allow compilation with
+ MSVC.
+
+ * bindings/cxx/getdata/entry.h bindings/cxx/getdata/fragment.h: Include
+ dirfile.h.
+
+ * test/include_cb.c test/madd_window.c test/open_cb_cont.c
+ test/open_cb_invalid.c test/include_pc.c test/test.h test/open_cb_rescan.c
+ test/open_cb_abort.c test/open_cb_ignore.c: Tweak for compilation with MSVC.
+
+ * test/add_meta_alias.c test/madd_affix.c test/parse_mplex_nomax.c
+ test/add_meta.c: Fix gd_entry_t access.
+
+ * util/checkdirfile.c: Preprocessor fixes for compilation with MSVC.
+
2012-04-21 D. V. Wiebe <ge...@ke...> svn:706
GetData-0.8.0rc1:
Modified: trunk/getdata/Makefile.am
===================================================================
--- trunk/getdata/Makefile.am 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/Makefile.am 2012-05-23 06:57:07 UTC (rev 709)
@@ -82,7 +82,7 @@
mkdir $(distdir)/man && \
cp ../man/*[35].html $(distdir)/man && \
cp -r bindings/cxx $(distdir)/bindings && \
- cp -r cmake src test $(distdir) && \
+ cp -r cmake util src test $(distdir) && \
$(SED) cmake/CMakeLists.txt \
-e 's/-DPACKAGE_VERSION=\\".*\\"/-DPACKAGE_VERSION=\\"$(PACKAGE_VERSION)\\"/' \
> $(distdir)/cmake/CMakeLists.txt && \
Modified: trunk/getdata/README.win
===================================================================
--- trunk/getdata/README.win 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/README.win 2012-05-23 06:57:07 UTC (rev 709)
@@ -4,21 +4,12 @@
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:
+described in detail in three manual pages distributed with this package:
- $ man man/dirfile.5
- $ man man/dirfile-format.5
- $ man man/dirfile-encoding.5
+ man/dirfile.5.html
+ man/dirfile-format.5.html
+ man/dirfile-encoding.5.html
-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:
@@ -98,30 +89,44 @@
BUILDING THE LIBRARY
====================
-This package may be built using Kitware's CMake build system. Consult the CMake
+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.
+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:
+Best practice is to build outside the source tree. 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
+ cmake -G"Visual Studio 10" ..\getdata-0.8\cmake
Then build the project as usual.
-The GetData test suit could be ebabled by setting the GD_TEST variable:
+This package comes with a few utility programs in the util subdirectory. They
+can be optionally built by setting the GD_UTIL variable:
- cmake . -DGD_TEST=1
+ cmake <path> -DGD_UTIL=1
+The GetData test suit can be ebabled by setting the GD_TEST variable:
+
+ cmake <path> -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.
+Verbose debugging output can be turned on by setting the GD_DEBUG variable:
+
+ cmake <path> -DGD_DEBUG=1
+
+These debugging messages are typically only useful to people debugging GetData
+itself. For release builds of GetData it should usually be left off, as they may
+have a negative performance impact.
+
+The install path can 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
+The file cmake/FindGetData.cmake may be used in projects managed by
CMake and which have to search for a GetData installation.
Property changes on: trunk/getdata/README.win
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/getdata/bindings/cxx/getdata/dirfile.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/bindings/cxx/getdata/dirfile.h 2012-05-23 06:57:07 UTC (rev 709)
@@ -22,6 +22,10 @@
#ifndef GETDATA_DIRFILE_H
#define GETDATA_DIRFILE_H
+#ifndef _FILE_OFFSET_BITS
+# define _FILE_OFFSET_BITS 64
+#endif
+
// We don't want the legacy API since its symbols clash with us.
#ifndef GD_NO_LEGACY_API
# define GD_NO_LEGACY_API
Modified: trunk/getdata/bindings/cxx/getdata/entry.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/entry.h 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/bindings/cxx/getdata/entry.h 2012-05-23 06:57:07 UTC (rev 709)
@@ -22,21 +22,7 @@
#ifndef GETDATA_ENTRY_H
#define GETDATA_ENTRY_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#ifndef GD_NO_LEGACY_API
-# define GD_NO_LEGACY_API
-#endif
-#ifndef GD_C89_API
-# define GD_C89_API
-#endif
-
-extern "C" {
-#include <getdata.h>
-}
-
+#include <getdata/dirfile.h>
#include <complex>
namespace GetData {
Modified: trunk/getdata/bindings/cxx/getdata/fragment.h
===================================================================
--- trunk/getdata/bindings/cxx/getdata/fragment.h 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/bindings/cxx/getdata/fragment.h 2012-05-23 06:57:07 UTC (rev 709)
@@ -22,23 +22,9 @@
#ifndef GETDATA_FRAGMENT_H
#define GETDATA_FRAGMENT_H
-#ifndef _FILE_OFFSET_BITS
-# define _FILE_OFFSET_BITS 64
-#endif
-
-#ifndef GD_NO_LEGACY_API
-# define GD_NO_LEGACY_API
-#endif
-#ifndef GD_C89_API
-# define GD_C89_API
-#endif
-
-extern "C" {
-#include <getdata.h>
-}
+#include <getdata/dirfile.h>
#include <sys/types.h>
-
namespace GetData {
enum EncodingScheme {
Property changes on: trunk/getdata/bindings/cxx/getdata/mplexentry.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/cxx/getdata/windowentry.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/cxx/internal.h
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/cxx/mplexentry.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-05-23 06:57:07 UTC (rev 709)
@@ -24,16 +24,26 @@
#undef GETDATA_LEGACY_API
#include "getdata/dirfile.h"
+#include "internal.h"
+
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
-#include <unistd.h>
#include <iostream>
#include <math.h>
+#include <stdlib.h>
#include <stdio.h>
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
#if MKDIR_NO_MODE
#ifdef HAVE__MKDIR
#define mkdir(f,m) _mkdir(f)
Property changes on: trunk/getdata/bindings/cxx/windowentry.cpp
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/f77/test/test_getdata.f.in
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/idl/package/Makefile.am
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/idl/package/README
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/idl/package/configure.ac
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/Build.PL.in
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/GetData.pm.in
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/GetData.xs
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/MANIFEST.in
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/Makefile.am
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/funclist.pl
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/simple_funcs.pl
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/simple_funcs.xsin
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/test/big_test.t
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/test/callback.t
___________________________________________________________________
Added: svn:eol-style
+ native
Property changes on: trunk/getdata/bindings/perl/typemap
___________________________________________________________________
Added: svn:eol-style
+ native
Modified: trunk/getdata/cmake/CMakeLists.txt
===================================================================
--- trunk/getdata/cmake/CMakeLists.txt 2012-05-03 20:47:35 UTC (rev 708)
+++ trunk/getdata/cmake/CMakeLists.txt 2012-05-23 06:57:07 UTC (rev 709)
@@ -3,135 +3,146 @@
project(getdata)
-#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
if(NOT GD_DIR)
- set(GD_DIR ${CMAKE_SOURCE_DIR}/..)
+ set(GD_DIR ${CMAKE_SOURCE_DIR}/..)
endif()
macro(GD_FILES name folder)
- file(GLOB ${name}_folder_sources ${GD_DIR}/${folder}/*.c)
- file(GLOB ${name}_folder_sources_cpp ${GD_DIR}/${folder}/*.cpp)
- file(GLOB ${name}_folder_headers ${GD_DIR}/${folder}/*.h)
- set(${name}_sources ${${name}_sources} ${${name}_folder_sources} ${${name}_folder_sources_cpp})
- set(${name}_headers ${${name}_headers} ${${name}_folder_headers})
- include_directories(${CMAKE_SOURCE_DIR}/${folder})
+ file(GLOB ${name}_folder_sources ${GD_DIR}/${folder}/*.c)
+ file(GLOB ${name}_folder_sources_cpp ${GD_DIR}/${folder}/*.cpp)
+ file(GLOB ${name}_folder_headers ${GD_DIR}/${folder}/*.h)
+ set(${name}_sources ${${name}_sources} ${${name}_folder_sources} ${${name}_folder_sources_cpp})
+ set(${name}_headers ${${name}_headers} ${${name}_folder_headers})
+ include_directories(${CMAKE_SOURCE_DIR}/${folder})
endmacro()
#TODO add configure
add_definitions(
- -DPACKAGE_NAME=\"GetData\"
- -DPACKAGE_VERSION=\"0.8.0\"
- -DPACKAGE_BUGREPORT=\"get...@li...\")
+ -DPACKAGE_NAME=\"GetData\"
+ -DPACKAGE_VERSION=\"0.8.0\"
+ -DPACKAGE_BUGREPORT=\"get...@li...\"
+ -DUNALIGNED_ACCESS_OK
+ )
-
-
-
# kst2 doesn't need the legacy API
set(DEFINE_GD_LEGACY_API "/* #undef GD_LEGACY_API */")
-# MSVCRT integer types
-
-
-
if(MSVC)
- ## Substitutions needed to build getdata.h
- # build in ANSI C mode
- set(DEFINE_GD_NO_C99_API "#define GD_NO_C99_API")
+ ## Substitutions needed to build getdata.h
+ # build in ANSI C mode
+ set(DEFINE_GD_NO_C99_API "#define GD_NO_C99_API")
- set(DEFINE_gd_int64_t "#define gd_int64_t __int64")
- set(DEFINE_gd_uint64_t "#define gd_uint64_t unsigned __int64")
+ # MSVCRT integer types
+ set(DEFINE_gd_int64_t "#define gd_int64_t __int64")
+ set(DEFINE_gd_uint64_t "#define gd_uint64_t unsigned __int64")
- 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
+ add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS)
+ add_definitions(
+ -D__MSVCRT__
+ -D_USE_MATH_DEFINES
+ -DHAVE__CHSIZE
+ -DHAVE__COMMIT
+ -DHAVE__FSTAT64
+ -DHAVE__GETCWD
+ -DHAVE__ISNAN
+ -DHAVE__MKDIR
+ -DHAVE__RMDIR
+ -DHAVE__SNPRINTF
+ -DHAVE__STAT64
+ -DHAVE__STRTOI64
+ -DHAVE__STRTOUI64
+ -DHAVE_DIRENT_H
+ -DHAVE_DIRECT_H
-DHAVE_FCNTL_H
- -DHAVE_LIBGEN_H
- -DSTDC_HEADERS
- -DHAVE_INTTYPES_H
- -DHAVE_IO_H
- -DHAVE_STDINT_H
+ -DHAVE_FLOAT_H
+ -DHAVE_LIBGEN_H
+ -DSTDC_HEADERS
+ -DHAVE_INTTYPES_H
+ -DHAVE_IO_H
+ -DHAVE_STDINT_H
+ -DHAVE_STRUCT___STAT64
-DHAVE_SYS_STAT_H
- -DHAVE__STAT64
- -DHAVE_STRUCT__STAT64
- -DHAVE__COMMIT
- -DHAVE__STRTOI64
- -DHAVE__STRTOUI64
- -DHAVE__GETCWD
-DGD_DIRSEP='\\\\'
+ -DMKDIR_NO_MODE
-Drestrict=
-DSIZEOF_INT=4
-DSIZEOF_UNSIGNED_INT=4
- )
- set(CMAKE_DEBUG_POSTFIX d)
-
- # ANSI C
- #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Za")
-
- # Suppress warnings
- string(REGEX REPLACE "/W[0-4]" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
-
- include_directories(${GD_DIR}/src/msvc)
+ )
+ set(CMAKE_DEBUG_POSTFIX d)
+
+ # ANSI C
+ #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Za")
+
+ # Suppress warnings
+ string(REGEX REPLACE "/W[0-4]" "/W0" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
+
+ include_directories(${GD_DIR}/src/msvc)
endif()
if(MINGW)
- set(DEFINE_gd_int16_t "#define gd_int16_t __int16")
- set(DEFINE_gd_uint16_t "#define gd_uint16_t unsigned __int16")
- set(DEFINE_gd_int64_t "#define gd_int64_t __int64")
- set(DEFINE_gd_uint64_t "#define gd_uint64_t unsigned __int64")
+ set(DEFINE_gd_int16_t "#define gd_int16_t __int16")
+ set(DEFINE_gd_uint16_t "#define gd_uint16_t unsigned __int16")
+ set(DEFINE_gd_int64_t "#define gd_int64_t __int64")
+ set(DEFINE_gd_uint64_t "#define gd_uint64_t unsigned __int64")
- add_definitions(
- -D__MSVCRT__
- -D__MSVCRT_VERSION__=0x0601
- -DSTDC_HEADERS
- -DHAVE_IO_H
- -DHAVE_STDINT_H
- -DHAVE_COMPLEX_H
- -DHAVE_OFF64_T
- -DHAVE_LIBGEN_H
- -DHAVE_STRTOLL
- -DHAVE_DIRENT_H
- -DHAVE_DIRECT_H
- -DHAVE__COMMIT
- -DHAVE__STAT64
- -DHAVE__STRTOI64
- -DHAVE__STRTOUI64
- -DHAVE_STRUCT___STAT64
- -DHAVE__GETCWD
- -DMKDIR_NO_MODE
- -DHAVE_SYS_FILE_H
- -DHAVE_SYS_STAT_H
- -DHAVE_DIRENT_H
- -DS_IFLNK=0xa000
- -DHAVE_DECL_OFFSETOF
- -DHAVE__CHSIZE
- -DGD_DIRSEP=0x53
- )
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
+ add_definitions(
+ -D__MSVCRT__
+ -D__MSVCRT_VERSION__=0x0601
+ -DSTDC_HEADERS
+ -DHAVE_IO_H
+ -DHAVE_STDINT_H
+ -DHAVE_COMPLEX_H
+ -DHAVE_OFF64_T
+ -DHAVE_LIBGEN_H
+ -DHAVE_STRTOLL
+ -DHAVE_DIRENT_H
+ -DHAVE_DIRECT_H
+ -DHAVE__COMMIT
+ -DHAVE__STAT64
+ -DHAVE__STRTOI64
+ -DHAVE__STRTOUI64
+ -DHAVE_STRUCT___STAT64
+ -DHAVE__GETCWD
+ -DMKDIR_NO_MODE
+ -DHAVE_SYS_FILE_H
+ -DHAVE_SYS_STAT_H
+ -DHAVE_DIRENT_H
+ -DS_IFLNK=0xa000
+ -DHAVE_DECL_OFFSETOF
+ -DHAVE__CHSIZE
+ -DGD_DIRSEP=0x53
+ )
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99")
endif()
+if(GD_TEST)
+ enable_testing()
+endif()
configure_file(${GD_DIR}/src/getdata.h.in ${CMAKE_BINARY_DIR}/getdata.h @ONLY)
include_directories(${GD_DIR}/src ${CMAKE_CURRENT_BINARY_DIR})
if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
- set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/INSTALLED CACHE PATH "install path" FORCE)
+ set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/INSTALLED CACHE PATH "install path" F...
[truncated message content] |
|
From: <ket...@us...> - 2012-05-23 17:40:29
|
Revision: 710
http://getdata.svn.sourceforge.net/getdata/?rev=710&view=rev
Author: ketiltrout
Date: 2012-05-23 17:40:23 +0000 (Wed, 23 May 2012)
Log Message:
-----------
msys+mingw fixes.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/cmake/test/CMakeLists.txt
trunk/getdata/configure.ac
trunk/getdata/src/compat.c
trunk/getdata/src/open.c
trunk/getdata/test/test.h
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-05-23 06:57:07 UTC (rev 709)
+++ trunk/getdata/ChangeLog 2012-05-23 17:40:23 UTC (rev 710)
@@ -1,4 +1,13 @@
-2012-05-22 D. V. Wiebe <ge...@ke...> svn:706
+2012-05-23 D. V. Wiebe <ge...@ke...> svn:710
+ * test/test.h: Don't redefine isnan if it's okay as-is.
+
+ * src/open.c (_GD_CreateDirfile): Don't unnecessarily disable mtime
+ acquisition.
+ * cmake/test/CMakeLists.txt: enable desync checks.
+
+ * src/compat.c (gd_strtod): Fix sign check.
+
+2012-05-22 D. V. Wiebe <ge...@ke...> svn:709
* cmake/CMakeLists.txt: Update definitons. Support GD_UTIL.
* cmake/test/CMakeLists.txt: Update the list of excluded tests.
* cmake/src/CMakeLists.txt: Support GD_DEBUG and conditionally build debug.c.
Modified: trunk/getdata/cmake/test/CMakeLists.txt
===================================================================
--- trunk/getdata/cmake/test/CMakeLists.txt 2012-05-23 06:57:07 UTC (rev 709)
+++ trunk/getdata/cmake/test/CMakeLists.txt 2012-05-23 17:40:23 UTC (rev 710)
@@ -20,7 +20,6 @@
if(MSVC)
set(tests_ignored
${tests_ignored}
- desync desync_flush desync_reopen desync_reopen_inv
error_verbose error_verbose_prefix
get64 get_uint64 get_endian64 get_int64 get_off64
nframes64
Modified: trunk/getdata/configure.ac
===================================================================
--- trunk/getdata/configure.ac 2012-05-23 06:57:07 UTC (rev 709)
+++ trunk/getdata/configure.ac 2012-05-23 17:40:23 UTC (rev 710)
@@ -699,7 +699,7 @@
AC_CHECK_FUNCS([basename _chsize _chsize_s _commit fchmod _fdopen fdopendir \
fpathconf fseeko fseeko64 _fstat fstat64 _fstat64 fstatat \
fstatat64 fsync ftello ftello64 ftruncate ftruncate64 getcwd \
- _getcwd getdelim gmtime_r _isnan lseek64 _lseeki64 lstat \
+ _getcwd getdelim gmtime_r isnan _isnan lseek64 _lseeki64 lstat \
lstat64 _mkdir mkfifo nan _open openat pathconf _read \
readdir_r readlink renameat _rmdir snprintf _snprintf stat64 \
_stat64 _strtoi64 strtoll _strtoui64 strtoull _unlink unlinkat \
Modified: trunk/getdata/src/compat.c
===================================================================
--- trunk/getdata/src/compat.c 2012-05-23 06:57:07 UTC (rev 709)
+++ trunk/getdata/src/compat.c 2012-05-23 17:40:23 UTC (rev 710)
@@ -343,7 +343,7 @@
/* skip sign */
if (*ptr == '+' || *ptr == '-') {
- if (ptr == '-')
+ if (*ptr == '-')
sign = 0x80;
ptr++;
}
Modified: trunk/getdata/src/open.c
===================================================================
--- trunk/getdata/src/open.c 2012-05-23 06:57:07 UTC (rev 709)
+++ trunk/getdata/src/open.c 2012-05-23 17:40:23 UTC (rev 710)
@@ -210,9 +210,7 @@
static FILE *_GD_CreateDirfile(DIRFILE *restrict D, int dirfd, int dir_error,
char *restrict dirfile, time_t *mtime)
{
-#ifndef GD_NO_DIR_OPEN
struct stat statbuf;
-#endif
int fd = -1;
int format_error = 0, format_trunc = 0;
FILE* fp = NULL;
@@ -377,11 +375,9 @@
D->dir[0].path = dirfile;
D->ndir = 1;
-#ifndef GD_NO_DIR_OPEN
/* get the mtime */
if (fstat(fd, &statbuf) == 0)
*mtime = statbuf.st_mtime;
-#endif
dreturn("%p", fp);
return fp;
Modified: trunk/getdata/test/test.h
===================================================================
--- trunk/getdata/test/test.h 2012-05-23 06:57:07 UTC (rev 709)
+++ trunk/getdata/test/test.h 2012-05-23 17:40:23 UTC (rev 710)
@@ -35,7 +35,7 @@
#include <float.h>
#endif
-#ifdef HAVE__ISNAN
+#if defined HAVE__ISNAN && ! defined HAVE_ISNAN
#define isnan _isnan
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ket...@us...> - 2012-05-23 23:24:55
|
Revision: 712
http://getdata.svn.sourceforge.net/getdata/?rev=712&view=rev
Author: ketiltrout
Date: 2012-05-23 23:24:48 +0000 (Wed, 23 May 2012)
Log Message:
-----------
Figure out the perl man3 extension at configure time.
Modified Paths:
--------------
trunk/getdata/bindings/perl/Makefile.am
trunk/getdata/m4/perl.m4
Modified: trunk/getdata/bindings/perl/Makefile.am
===================================================================
--- trunk/getdata/bindings/perl/Makefile.am 2012-05-23 18:42:04 UTC (rev 711)
+++ trunk/getdata/bindings/perl/Makefile.am 2012-05-23 23:24:48 UTC (rev 712)
@@ -30,7 +30,7 @@
PERL_TESTS=t/big_test.t t/callback.t
man3dir=${perlmandir}
-nodist_man3_MANS=blib/libdoc/GetData.3
+nodist_man3_MANS=blib/libdoc/GetData.$(PERL_MAN3EXT)
nodist_perl_SCRIPTS=blib/lib/GetData.pm
@@ -71,20 +71,11 @@
$(PERL) $(srcdir)/funclist.pl lib/GetData.xs lib/simple_funcs.xs > $@
chmod a-w $@
-blib/arch/auto/GetData/GetData.bs: Build lib/GetData.xs lib/simple_funcs.xs \
- lib/typemap
+blib/arch/auto/GetData/GetData.bs blib/arch/auto/GetData/GetData.so \
+ blib/lib/GetData.pm blib/libdoc/GetData.$(PERL_MAN3EXT): Build \
+ lib/GetData.xs lib/simple_funcs.xs lib/typemap
$(PERL) Build build
- touch $@
-blib/arch/auto/GetData/GetData.so: blib/arch/auto/GetData/GetData.bs
- touch $@
-
-blib/lib/GetData.pm: blib/arch/auto/GetData/GetData.bs
- touch $@
-
-blib/libdoc/GetData.3: blib/arch/auto/GetData/GetData.bs
- touch $@
-
.PRECIOUS: Build
Build: Build.PL GetData.pm lib/GetData.xs lib/simple_funcs.xs lib/typemap \
MANIFEST
Modified: trunk/getdata/m4/perl.m4
===================================================================
--- trunk/getdata/m4/perl.m4 2012-05-23 18:42:04 UTC (rev 711)
+++ trunk/getdata/m4/perl.m4 2012-05-23 23:24:48 UTC (rev 712)
@@ -46,9 +46,20 @@
fi
])
+dnl GD_PERL_MAN3EXT
+dnl ---------------------------------------------------------------
+dnl Define PERL_MAN3EXT to the section 3 manual extension used by Module::Build
+AC_DEFUN([GD_PERL_MAN3EXT],
+[
+AC_MSG_CHECKING([for the section 3 manual page extension])
+PERL_MAN3EXT=`$PERL -MModule::Build -e 'print Module::Build->new(module_name=>"conftest",dist_version=>0)->config('man3ext');'`
+AC_MSG_RESULT([.$PERL_MAN3EXT])
+AC_SUBST([PERL_MAN3EXT])
+])
+
dnl GD_PERL_CHECK_MODULE
dnl ---------------------------------------------------------------
-dnl Define HAVE_<MODULE_NAME> if the specified encoding exists
+dnl Define HAVE_<MODULE_NAME> if the specified module exists
AC_DEFUN([GD_PERL_CHECK_MODULE],
[
AC_MSG_CHECKING([for $1])
@@ -180,5 +191,6 @@
AC_SUBST([perlmandir])
AC_MSG_RESULT([$perlmandir])
+ GD_PERL_MAN3EXT
fi
])
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|