[Getdata-commits] SF.net SVN: getdata:[728] trunk/getdata
Scientific Database Format
Brought to you by:
ketiltrout
|
From: <ket...@us...> - 2012-06-29 00:29:53
|
Revision: 728
http://getdata.svn.sourceforge.net/getdata/?rev=728&view=rev
Author: ketiltrout
Date: 2012-06-29 00:29:46 +0000 (Fri, 29 Jun 2012)
Log Message:
-----------
Merge GD_E_BAD_VERSION into GD_E_ARGUMENT. Doc updates.
Modified Paths:
--------------
trunk/getdata/ChangeLog
trunk/getdata/NEWS
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/make_parameters.c
trunk/getdata/bindings/perl/test/big_test.t
trunk/getdata/bindings/python/pygetdata.c
trunk/getdata/bindings/python/test/big_test.py
trunk/getdata/doc/README.cxx
trunk/getdata/doc/README.f77
trunk/getdata/doc/README.idl
trunk/getdata/man/Makefile.am
trunk/getdata/man/gd_dirfile_standards.3
trunk/getdata/man/gd_entry_list.3
trunk/getdata/man/gd_nentries.3
trunk/getdata/src/errors.c
trunk/getdata/src/flush.c
trunk/getdata/src/getdata.h.in
trunk/getdata/src/internal.h
trunk/getdata/src/legacy.c
Added Paths:
-----------
trunk/getdata/man/gd_strtok.3
Modified: trunk/getdata/ChangeLog
===================================================================
--- trunk/getdata/ChangeLog 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/ChangeLog 2012-06-29 00:29:46 UTC (rev 728)
@@ -1,3 +1,7 @@
+2012-06-29 D. V. Wiebe <ge...@ke...> svn:728
+ * src/getdata.h.in src/internal.h src/errors.c: Merge GD_E_BAD_VERSION into
+ GD_E_ARGUMENT.
+
2012-06-28 D. V. Wiebe <ge...@ke...> svn:725,726
* util/checkdirfile.c: Find and report dangling aliases.
Modified: trunk/getdata/NEWS
===================================================================
--- trunk/getdata/NEWS 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/NEWS 2012-06-29 00:29:46 UTC (rev 728)
@@ -227,13 +227,14 @@
* 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
+ * When requesting the exclusive creation of a new dirfile with (GD_CREAT |
+ GD_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.
+ * The error codes GD_E_BAD_ENDIANNESS, GD_E_BAD_PROTECTION, and
+ GD_E_BAD_VERSION have been combined into a more generic error code:
+ GD_E_ARGUMENT. The old symbols are retained for backwards compatibility but
+ have been marked deprecated.
* 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).
Modified: trunk/getdata/bindings/cxx/test/big_test.cpp
===================================================================
--- trunk/getdata/bindings/cxx/test/big_test.cpp 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/cxx/test/big_test.cpp 2012-06-29 00:29:46 UTC (rev 728)
@@ -1265,7 +1265,7 @@
CHECK_OK2(157,1);
CHECK_INT(157,n,9);
d->Standards(0);
- CHECK_ERROR2(157,2,GD_E_BAD_VERSION);
+ CHECK_ERROR2(157,2,GD_E_ARGUMENT);
// 158 gd_get_carray
n = d->GetCarray("carray", Float64, p);
Modified: trunk/getdata/bindings/f77/test/big_test.f
===================================================================
--- trunk/getdata/bindings/f77/test/big_test.f 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/f77/test/big_test.f 2012-06-29 00:29:46 UTC (rev 728)
@@ -1608,7 +1608,7 @@
n = 0
CALL GDSTDV(n, d)
- CALL CHKER2(ne, 157, 2, d, GD_EVR)
+ CALL CHKER2(ne, 157, 2, d, GD_EAR)
C 158: GDGTCA check
CALL GDGTCA(d, 'carray', 6, GD_F64, p)
Modified: trunk/getdata/bindings/f77/test/big_test95.f90
===================================================================
--- trunk/getdata/bindings/f77/test/big_test95.f90 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/f77/test/big_test95.f90 2012-06-29 00:29:46 UTC (rev 728)
@@ -1751,7 +1751,7 @@
call check_int(ne, 157, n, 9)
n = fgd_dirfile_standards(d, 0)
- call check_err2(ne, 157, 2, d, GD_E_BAD_VERSION)
+ call check_err2(ne, 157, 2, d, GD_E_ARGUMENT)
! 158: gd_get_carray_slice (INT8)
call fgd_get_carray_i1(d, "carray", 0, 0, ci1)
Modified: trunk/getdata/bindings/idl/test/big_test.pro
===================================================================
--- trunk/getdata/bindings/idl/test/big_test.pro 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/idl/test/big_test.pro 2012-06-29 00:29:46 UTC (rev 728)
@@ -1026,7 +1026,7 @@
nume += check_ok2(157, 1, d)
nume += check_simple(157, n, 9)
n = gd_dirfile_standards(d, 0)
-nume += check_error2(157, 2, d, !GD.E_BAD_VERSION)
+nume += check_error2(157, 2, d, !GD.E_ARGUMENT)
; 158: gd_get_carray
n = gd_get_carray(d, "carray", type=!GD.FLOAT32)
Modified: trunk/getdata/bindings/make_parameters.c
===================================================================
--- trunk/getdata/bindings/make_parameters.c 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/make_parameters.c 2012-06-29 00:29:46 UTC (rev 728)
@@ -89,7 +89,6 @@
CONSTANT(E_UNCLEAN_DB, "GD_UCL", 0),
CONSTANT(E_DOMAIN, "GD_EDO", 0),
CONSTANT(E_BAD_REPR, "GD_ERP", 0),
- CONSTANT(E_BAD_VERSION, "GD_EVR", 0),
CONSTANT(E_FLUSH, "GD_EFL", 0),
CONSTANT(E_BOUNDS, "GD_EBO", 0),
CONSTANT(E_LINE_TOO_LONG, "GD_ETL", 0),
@@ -97,6 +96,7 @@
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(E_BAD_VERSION, "GD_EVR", 0), /* deprecated */
CONSTANT(RDONLY, "GD_RO", 1),
CONSTANT(RDWR, "GD_RW", 1),
Modified: trunk/getdata/bindings/perl/test/big_test.t
===================================================================
--- trunk/getdata/bindings/perl/test/big_test.t 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/perl/test/big_test.t 2012-06-29 00:29:46 UTC (rev 728)
@@ -1328,7 +1328,7 @@
CheckNum2(157, 2, $s, $GetData::DIRFILE_STANDARDS_VERSION);
$s = $_->dirfile_standards(0);
-CheckError2(157, 3, $GetData::E_BAD_VERSION);
+CheckError2(157, 3, $GetData::E_ARGUMENT);
CheckNum2(157, 4, $s, undef);
# 158: get_carray
Modified: trunk/getdata/bindings/python/pygetdata.c
===================================================================
--- trunk/getdata/bindings/python/pygetdata.c 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/python/pygetdata.c 2012-06-29 00:29:46 UTC (rev 728)
@@ -49,13 +49,13 @@
"BadReference",
"Protected",
"Deletion",
- "BadArgument",
+ "Argument",
"Callback",
"Exists",
"UncleanDatabase",
"Domain",
"BadRepr",
- "BadVersion",
+ NULL,
"Flush",
"Bounds",
"LineTooLong"
Modified: trunk/getdata/bindings/python/test/big_test.py
===================================================================
--- trunk/getdata/bindings/python/test/big_test.py 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/bindings/python/test/big_test.py 2012-06-29 00:29:46 UTC (rev 728)
@@ -1325,7 +1325,7 @@
try:
d.standards = 0
except:
- CheckException2(157,2,pygetdata.BadVersionError)
+ CheckException2(157,2,pygetdata.ArgumentError)
# 158: gd_get_carray
try:
Modified: trunk/getdata/doc/README.cxx
===================================================================
--- trunk/getdata/doc/README.cxx 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/doc/README.cxx 2012-06-29 00:29:46 UTC (rev 728)
@@ -218,8 +218,8 @@
* 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::EntryList(const char *parent = NULL, 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)
@@ -256,8 +256,8 @@
* 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::NEntries(const char *parent = NULL, int type = 0,
+ unsigned int flags = 0)
* unsigned int Dirfile::NFields()
* unsigned int Dirfile::NFieldsByType(GetData::EntryType type)
* off_t Dirfile::NFrames()
Modified: trunk/getdata/doc/README.f77
===================================================================
--- trunk/getdata/doc/README.f77 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/doc/README.f77 2012-06-29 00:29:46 UTC (rev 728)
@@ -1998,7 +1998,7 @@
GD_ETL GD_E_LINE_TOO_LONG
GD_ETR GD_E_TRUNC
GD_EUE GD_E_UNKNOWN_ENCODING
- GD_EVR GD_E_BAD_VERSION
+ GD_EVR GD_E_BAD_VERSION Deprecated; kept as an alias for GD_EAR.
GD_UCL GD_E_UNCLEAN_DB
GD_UNS GD_E_UNSUPPORTED
Modified: trunk/getdata/doc/README.idl
===================================================================
--- trunk/getdata/doc/README.idl 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/doc/README.idl 2012-06-29 00:29:46 UTC (rev 728)
@@ -591,16 +591,17 @@
This function returns a GD_ENTRY structure containing the field metadata for
the field specified by 'field_code'. See gd_entry(3).
-FUNCTION GD_ENTRY_LIST(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS,
- TYPE=type, /VECTORS)
+FUNCTION GD_ENTRY_LIST(dirfile_unit, /ALIASES, /HIDDEN, /NOALIAS, PARENT=parent,
+ /SCALARS, TYPE=type, /VECTORS)
This function returns a list of entry names defined by the dirfile. If PARENT
is given, a list of metafields for the given parent will be returned otherwise
top-level fields are considered. If TYPE is given, which should be one of the
!GD.*_ENTRY constants, only fields of the given type will be returned. If
- /SCALARS or /VECTORS is specified, the TYPE parameter is ignored if it is also
- given. The list returned includes aliases, unless /NOALIAS is specified, but
- not hidden fields, unless /HIDDEN is specified. See gd_entry_list(3).
+ /ALIASES, /SCALARS or /VECTORS is specified, the TYPE parameter is ignored if
+ it is also given. The list returned includes aliases, unless /NOALIAS is
+ specified, but not hidden fields, unless /HIDDEN is specified. See
+ gd_entry_list(3).
FUNCTION GD_ENTRY_TYPE(dirfile_unit, field_code)
@@ -783,19 +784,18 @@
The return value will be one of the data type constants: !GD.UINT8, !GD.INT8,
&c. See gd_native_type(3).
-FUNCTION GD_NENTRIES(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS,
- TYPE=type, /VECTORS)
+FUNCTION GD_NENTRIES(dirfile_unit, /ALIAS, /HIDDEN, /NOALIAS, PARENT=parent,
+ /SCALARS, TYPE=type, /VECTORS)
This function returns the number of entries in the dirfile satisfying the
given criteria. If PARENT is given, the number of metafields for the given
parent will be returned otherwise top-level fields are considered. If TYPE is
given, which should be one of the !GD.*_ENTRY constants, only fields of the
- given type will be counted. If /SCALARS or /VECTORS is specified, the TYPE
- parameter is ignored if it is also given. The number returned includes
- aliases, unless /NOALIAS is specified, but not hidden fields, unless /HIDDEN
- is specified. See gd_nentries(3).
+ given type will be counted. If /ALIASES, /SCALARS or /VECTORS is specified,
+ the TYPE parameter is ignored if it is also given. The number returned
+ includes aliases, unless /NOALIAS is specified, but not hidden fields, unless
+ /HIDDEN is specified. See gd_nentries(3).
-
FUNCTION GD_NFIELDS(dirfile_unit, /HIDDEN, /NOALIAS, PARENT=parent, /SCALARS,
TYPE=type, /VECTORS)
Modified: trunk/getdata/man/Makefile.am
===================================================================
--- trunk/getdata/man/Makefile.am 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/man/Makefile.am 2012-06-29 00:29:46 UTC (rev 728)
@@ -44,9 +44,9 @@
gd_protection.3 gd_put_carray_slice.3 gd_put_constant.3 \
gd_put_string.3 gd_putdata.3 gd_putdata64.3 gd_raw_filename.3 \
gd_reference.3 gd_rename.3 gd_rewrite_fragment.3 gd_seek.3 \
- gd_seek64.3 gd_spf.3 gd_strings.3 gd_tell.3 gd_tell64.3 \
- gd_uninclude.3 gd_validate.3 gd_verbose_prefix.3 dirfile.5 \
- dirfile-encoding.5 dirfile-format.5
+ gd_seek64.3 gd_spf.3 gd_strings.3 gd_strtok.3 gd_tell.3 \
+ gd_tell64.3 gd_uninclude.3 gd_validate.3 gd_verbose_prefix.3 \
+ dirfile.5 dirfile-encoding.5 dirfile-format.5
# these are real_file:alias
MAN3ALIASES=gd_add_bit.3:gd_add_carray.3 gd_add_bit.3:gd_add_clincom.3 \
Modified: trunk/getdata/man/gd_dirfile_standards.3
===================================================================
--- trunk/getdata/man/gd_dirfile_standards.3 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/man/gd_dirfile_standards.3 2012-06-29 00:29:46 UTC (rev 728)
@@ -1,6 +1,6 @@
.\" gd_dirfile_standards.3. The gd_dirfile_standards man page.
.\"
-.\" Copyright (C) 2010 D. V. Wiebe
+.\" Copyright (C) 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_dirfile_standards 3 "15 October 2010" "Version 0.7.0" "GETDATA"
+.TH gd_dirfile_standards 3 "29 June 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_dirfile_standards \(em change or report the current Dirfile Standards Version
for a DirFile
@@ -93,12 +93,12 @@
error value, and the current Standards Version is not changed. Possible error
values are:
.TP 8
+.B GD_E_ARGUMENT
+The loaded dirfile did not conform to the specified version. Or the dirfile
+conforms to no known Standards Version.
+.TP
.B GD_E_BAD_DIRFILE
The supplied dirfile was invalid.
-.TP
-.B GD_E_BAD_VERSION
-The loaded dirfile did not conform to the specified version. Or the dirfile
-conforms to no known Standards Version.
.PP
The dirfile error may be retrieved by calling
.BR gd_error (3).
Modified: trunk/getdata/man/gd_entry_list.3
===================================================================
--- trunk/getdata/man/gd_entry_list.3 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/man/gd_entry_list.3 2012-06-29 00:29:46 UTC (rev 728)
@@ -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_list 3 "1 April 2012" "Version 0.8.0" "GETDATA"
+.TH gd_entry_list 3 "28 June 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_entry_list, gd_field_list, gd_field_list_by_type gd_mfield_list, gd_mfield_list_by_type,
gd_mvector_list, gd_vector_list \(em list field entries in a dirfile
@@ -73,14 +73,18 @@
field) or else one of the following special symbols:
.TP
.B GD_ALL_ENTRIES \fR(= 0)
-Count entries of all types.
+List entries of all types.
.TP
+.B GD_ALIAS_ENTRIES
+List only aliases. This is the only way to get a list including aliases which
+do not point to valid field codes.
+.TP
.B GD_SCALAR_ENTRIES
-Count only scalar field types
+List only scalar field types
.RB ( CONST ", " CARRAY ", " STRING ).
.TP
.B GD_VECTOR_ENTRIES
-Count only vector field types (all field types except the scalar field types
+List only vector field types (all field types except the scalar field types
listed above).
.PP
The
Modified: trunk/getdata/man/gd_nentries.3
===================================================================
--- trunk/getdata/man/gd_nentries.3 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/man/gd_nentries.3 2012-06-29 00:29:46 UTC (rev 728)
@@ -13,7 +13,7 @@
.\" Texts. A copy of the license is included in the `COPYING.DOC' file
.\" as part of this distribution.
.\"
-.TH gd_nentries 3 "1 April 2012" "Version 0.8.0" "GETDATA"
+.TH gd_nentries 3 "28 June 2012" "Version 0.8.0" "GETDATA"
.SH NAME
gd_nentries, gd_nfields, gd_nfields_by_type gd_nmfields, gd_nmfields_by_type,
gd_nmvectors, gd_nvectors \(em count field entries in a dirfile
@@ -75,6 +75,10 @@
.B GD_ALL_ENTRIES \fR(= 0)
Count entries of all types.
.TP
+.B GD_ALIAS_ENTRIES
+Count only aliases. This is the only way to get a count including aliases which
+do not point to valid field codes.
+.TP
.B GD_SCALAR_ENTRIES
Count only scalar field types
.RB ( CONST ", " CARRAY ", " STRING ).
Added: trunk/getdata/man/gd_strtok.3
===================================================================
--- trunk/getdata/man/gd_strtok.3 (rev 0)
+++ trunk/getdata/man/gd_strtok.3 2012-06-29 00:29:46 UTC (rev 728)
@@ -0,0 +1,97 @@
+.\" gd_strtok.3. The gd_strtok 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_strtok 3 "28 June 2012" "Version 0.8.0" "GETDATA"
+.SH NAME
+gd_strtok \(em tokenise a string using the GetData parser
+.SH SYNOPSIS
+.B #include <getdata.h>
+.HP
+.nh
+.ad l
+.BI "char *gd_strtok(DIRFILE *" dirfile ", const char *" string );
+.hy
+.ad n
+.SH DESCRIPTION
+The
+.BR gd_strtok ()
+function parses a string into a series of tokens according to the rules of the
+Dirfile metadata syntax (see dirfile-format(5)). The first time
+.BR gd_strtok ()
+is called, the string to be parsed should be passed in
+.IR string .
+The first token will be returned. In subsequent calls to parse the same string,
+.I string
+should be NULL (as with
+.BR strtok (3)).
+Each time
+.BR gd_strtok ()
+is called like this, the next token is returned.
+
+Operation of the Dirfile tokeniser varies between Dirfile Standards Versions.
+The Standards Version used is the current Version of the loaded DIRFILE
+.IR dirfile .
+Use
+.BR gd_dirfile_standards (3)
+to retrieve or change this value. Changing the Standards Version of
+.I dirfile
+while parsing a string will affect the parsing of subsequent tokens, but does
+not affect tokens already returned. A copy of the string is cached in the
+.I dirfile
+object. Calling
+.BR gd_strtok ()
+with different
+.IR dirfile s
+will parse different strings.
+
+.SH RETURN VALUE
+Upon successful completion,
+.BR gd_strtok ()
+returns a copy of the first token (if
+.I string
+is non-NULL), or the subsequent token. The token strings returned are each
+allocated with
+.BR malloc (3)
+and should be deallocated by the caller when no longer needed using
+.BR free (3).
+.PP
+If no more tokens are available, or if an error occurred, NULL is returned.
+If an error has occurred, it will also set the dirfile error a non-zero error
+value. Possible error values are:
+.TP 8
+.B GD_E_ALLOC
+A memory allocation error occurred.
+.TP
+.B GD_E_ARGUMENT
+There was no string to parse (i.e.
+.I string
+was NULL, but no previous call specified a string to parse).
+.TP
+.B GD_E_BAD_DIRFILE
+The supplied dirfile was invalid.
+.TP
+.B GD_E_FORMAT
+A syntax error was found in the string.
+.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 SEE ALSO
+.BR gd_dirfile_standards (3),
+.BR gd_open (3),
+.BR dirfile-format (5)
Modified: trunk/getdata/src/errors.c
===================================================================
--- trunk/getdata/src/errors.c 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/src/errors.c 2012-06-29 00:29:46 UTC (rev 728)
@@ -176,6 +176,10 @@
{ GD_E_ARGUMENT, GD_E_ARG_PROTECTION, "Invalid protection level specified",
0 },
{ GD_E_ARGUMENT, GD_E_ARG_NODATA, "No data", 0 },
+ { GD_E_ARGUMENT, GD_E_ARG_NO_VERS, "Dirfile conforms to no Standards Version",
+ 0 },
+ { GD_E_ARGUMENT, GD_E_ARG_BAD_VERS,
+ "Dirfile does not conform to specified Standards Version", 0 },
{ GD_E_ARGUMENT, 0, "Bad argument", 0 },
/* GD_E_CALLBACK: 3 = response */
{ GD_E_CALLBACK, 0, "Unrecognised response from callback function: {3}", 0 },
@@ -193,11 +197,6 @@
{ GD_E_BAD_REPR, GD_E_REPR_UNKNOWN, "Unknown field representation: .{4}", 0 },
{ GD_E_BAD_REPR, GD_E_REPR_PUT, "Unable to write to field reprentation: .{4}",
0 },
- /* GD_E_BAD_VERSION 3 = version */
- { GD_E_BAD_VERSION, GD_E_VERS_NONE,
- "Dirfile conforms to no Standards Version", 0 },
- { GD_E_BAD_VERSION, GD_E_VERS_MISSING,
- "Dirfile does not conform to Standards Version {3}", 0 },
/* GD_E_FLUSH: 3 = suberror, 4 = filename */
{ GD_E_FLUSH, GD_E_FLUSH_MKTMP, "I/O error creating temporary file: ", 1 },
{ GD_E_FLUSH, GD_E_FLUSH_OPEN, "I/O error opening temporary file: ", 1 },
Modified: trunk/getdata/src/flush.c
===================================================================
--- trunk/getdata/src/flush.c 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/src/flush.c 2012-06-29 00:29:46 UTC (rev 728)
@@ -1167,8 +1167,8 @@
if (vers < 0 || vers > GD_DIRFILE_STANDARDS_VERSION ||
~D->av & (1ULL << vers))
{
- _GD_SetError(D, GD_E_BAD_VERSION, (D->av == 0) ? GD_E_VERS_NONE :
- GD_E_VERS_MISSING, NULL, vers, NULL);
+ _GD_SetError(D, GD_E_ARGUMENT, (D->av == 0) ? GD_E_ARG_NO_VERS :
+ GD_E_ARG_BAD_VERS, NULL, vers, NULL);
dreturn("%i", -1);
return -1;
}
Modified: trunk/getdata/src/getdata.h.in
===================================================================
--- trunk/getdata/src/getdata.h.in 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/src/getdata.h.in 2012-06-29 00:29:46 UTC (rev 728)
@@ -157,7 +157,7 @@
#define GD_E_UNCLEAN_DB 30
#define GD_E_DOMAIN 31
#define GD_E_BAD_REPR 32
-#define GD_E_BAD_VERSION 33
+/* unused 33 */
#define GD_E_FLUSH 34
#define GD_E_BOUNDS 35
#define GD_E_LINE_TOO_LONG 36
@@ -168,6 +168,7 @@
#define GD_E_OPEN_INCLUDE GD_E_OPEN_FRAGMENT
#define GD_E_BAD_ENDIANNESS GD_E_ARGUMENT
#define GD_E_BAD_PROTECTION GD_E_ARGUMENT
+#define GD_E_BAD_VERSION GD_E_ARGUMENT
#define GD_MAX_LINCOM 3
Modified: trunk/getdata/src/internal.h
===================================================================
--- trunk/getdata/src/internal.h 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/src/internal.h 2012-06-29 00:29:46 UTC (rev 728)
@@ -728,14 +728,14 @@
#define GD_E_UNENC_UNDET 1
#define GD_E_UNENC_TARGET 2
-#define GD_E_VERS_NONE 1
-#define GD_E_VERS_MISSING 2
-
#define GD_E_ARG_WHENCE 1
#define GD_E_ARG_ENDIANNESS 2
#define GD_E_ARG_PROTECTION 3
#define GD_E_ARG_NODATA 4
+#define GD_E_ARG_NO_VERS 5
+#define GD_E_ARG_BAD_VERS 6
+
/* I/O flags */
#define GD_FILE_READ 0x1
#define GD_FILE_WRITE 0x2
Modified: trunk/getdata/src/legacy.c
===================================================================
--- trunk/getdata/src/legacy.c 2012-06-28 00:25:11 UTC (rev 727)
+++ trunk/getdata/src/legacy.c 2012-06-29 00:29:46 UTC (rev 728)
@@ -76,7 +76,7 @@
NULL, /* GD_E_UNCLEAN_DB */
"Improper domain", /* GD_E_DOMAIN */
"Bad representation", /* GD_E_BAD_REPR */
- NULL, /* GD_E_BAD_VERSION */
+ NULL, /* unused */
NULL, /* GD_E_FLUSH */
NULL, /* GD_E_BOUNDS */
"Line too long", /* GD_E_LINE_TOO_LONG */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|