mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-11-21 03:13:42 +08:00
Eliminate NC_MAX_VARS|DIMS|ATTRS limits
This commit is contained in:
parent
d18378c69b
commit
1503013e33
@ -15,14 +15,14 @@ NetCDF Error Code Listing {#nc-error-codes}
|
||||
#define NC_ENOTINDEFINE (-38) // Operation not allowed in data mode
|
||||
#define NC_EINDEFINE (-39) // Operation not allowed in define mode
|
||||
#define NC_EINVALCOORDS (-40) // Index exceeds dimension bound
|
||||
#define NC_EMAXDIMS (-41) // NC_MAX_DIMS exceeded
|
||||
#define NC_EMAXDIMS (-41) // NC_MAX_DIMS exceeded [not enforced after 4.5.0]
|
||||
#define NC_ENAMEINUSE (-42) // String match to name in use
|
||||
#define NC_ENOTATT (-43) // Attribute not found
|
||||
#define NC_EMAXATTS (-44) // NC_MAX_ATTRS exceeded
|
||||
#define NC_EMAXATTS (-44) // NC_MAX_ATTRS exceeded [not enforced after 4.5.0]
|
||||
#define NC_EBADTYPE (-45) // Not a netcdf data type
|
||||
#define NC_EBADDIM (-46) // Invalid dimension id or name
|
||||
#define NC_EUNLIMPOS (-47) // NC_UNLIMITED in the wrong index
|
||||
#define NC_EMAXVARS (-48) // NC_MAX_VARS exceeded
|
||||
#define NC_EMAXVARS (-48) // NC_MAX_VARS exceeded [not enforced after 4.5.0]
|
||||
#define NC_ENOTVAR (-49) // Variable not found
|
||||
#define NC_EGLOBAL (-50) // Action prohibited on NC_GLOBAL varid
|
||||
#define NC_ENOTNC (-51) // Not a netcdf file
|
||||
|
@ -12249,14 +12249,14 @@ nc_strerror
|
||||
#define NC_ENOTINDEFINE (-38) /* Operation not allowed in data mode */
|
||||
#define NC_EINDEFINE (-39) /* Operation not allowed in define mode */
|
||||
#define NC_EINVALCOORDS (-40) /* Index exceeds dimension bound */
|
||||
#define NC_EMAXDIMS (-41) /* NC_MAX_DIMS exceeded */
|
||||
#define NC_EMAXDIMS (-41) /* NC_MAX_DIMS exceeded */ /* not enforced after 4.5.0 */
|
||||
#define NC_ENAMEINUSE (-42) /* String match to name in use */
|
||||
#define NC_ENOTATT (-43) /* Attribute not found */
|
||||
#define NC_EMAXATTS (-44) /* NC_MAX_ATTRS exceeded */
|
||||
#define NC_EMAXATTS (-44) /* NC_MAX_ATTRS exceeded */ /* not enforced after 4.5.0 */
|
||||
#define NC_EBADTYPE (-45) /* Not a netcdf data type */
|
||||
#define NC_EBADDIM (-46) /* Invalid dimension id or name */
|
||||
#define NC_EUNLIMPOS (-47) /* NC_UNLIMITED in the wrong index */
|
||||
#define NC_EMAXVARS (-48) /* NC_MAX_VARS exceeded */
|
||||
#define NC_EMAXVARS (-48) /* NC_MAX_VARS exceeded */ /* not enforced after 4.5.0 */
|
||||
#define NC_ENOTVAR (-49) /* Variable not found */
|
||||
#define NC_EGLOBAL (-50) /* Action prohibited on NC_GLOBAL varid */
|
||||
#define NC_ENOTNC (-51) /* Not a netcdf file */
|
||||
|
@ -342,11 +342,11 @@ larger than the corresponding dimension length will cause an error. */
|
||||
/** NC_MAX_DIMS exceeded. Max number of dimensions exceeded in a
|
||||
classic or 64-bit offset file, or an netCDF-4 file with
|
||||
::NC_CLASSIC_MODEL on. */
|
||||
#define NC_EMAXDIMS (-41)
|
||||
#define NC_EMAXDIMS (-41) /* not enforced after 4.5.0 */
|
||||
|
||||
#define NC_ENAMEINUSE (-42) /**< String match to name in use */
|
||||
#define NC_ENOTATT (-43) /**< Attribute not found */
|
||||
#define NC_EMAXATTS (-44) /**< NC_MAX_ATTRS exceeded */
|
||||
#define NC_EMAXATTS (-44) /**< NC_MAX_ATTRS exceeded */ /* not enforced after 4.5.0 */
|
||||
#define NC_EBADTYPE (-45) /**< Not a netcdf data type */
|
||||
#define NC_EBADDIM (-46) /**< Invalid dimension id or name */
|
||||
#define NC_EUNLIMPOS (-47) /**< NC_UNLIMITED in the wrong index */
|
||||
@ -354,7 +354,7 @@ classic or 64-bit offset file, or an netCDF-4 file with
|
||||
/** NC_MAX_VARS exceeded. Max number of variables exceeded in a
|
||||
classic or 64-bit offset file, or an netCDF-4 file with
|
||||
::NC_CLASSIC_MODEL on. */
|
||||
#define NC_EMAXVARS (-48)
|
||||
#define NC_EMAXVARS (-48) /* not enforced after 4.5.0 */
|
||||
|
||||
/** Variable not found.
|
||||
|
||||
|
@ -94,7 +94,7 @@ unlimited dimensions.
|
||||
\returns ::NC_ENOTINDEFINE Not in define mode.
|
||||
\returns ::NC_EDIMSIZE Invalid dimension size.
|
||||
\returns ::NC_EUNLIMIT NC_UNLIMITED size already in use
|
||||
\returns ::NC_EMAXDIMS NC_MAX_DIMS exceeded
|
||||
\returns ::NC_EMAXDIMS NC_MAX_DIMS exceeded [not enforced after 4.5.0]
|
||||
\returns ::NC_ENAMEINUSE String match to name in use
|
||||
\returns ::NC_ENOMEM Memory allocation (malloc) failure
|
||||
\returns ::NC_EPERM Write to read only
|
||||
|
@ -118,20 +118,20 @@ const char *nc_strerror(int ncerr1)
|
||||
case NC_EINVALCOORDS:
|
||||
return "NetCDF: Index exceeds dimension bound";
|
||||
case NC_EMAXDIMS:
|
||||
return "NetCDF: NC_MAX_DIMS exceeded";
|
||||
return "NetCDF: NC_MAX_DIMS exceeded"; /* not enforced after 4.5.0 */
|
||||
case NC_ENAMEINUSE:
|
||||
return "NetCDF: String match to name in use";
|
||||
case NC_ENOTATT:
|
||||
return "NetCDF: Attribute not found";
|
||||
case NC_EMAXATTS:
|
||||
return "NetCDF: NC_MAX_ATTRS exceeded";
|
||||
return "NetCDF: NC_MAX_ATTRS exceeded"; /* not enforced after 4.5.0 */
|
||||
case NC_EBADTYPE:
|
||||
return "NetCDF: Not a valid data type or _FillValue type mismatch";
|
||||
case NC_EBADDIM:
|
||||
return "NetCDF: Invalid dimension ID or name";
|
||||
case NC_EUNLIMPOS:
|
||||
return "NetCDF: NC_UNLIMITED in the wrong index";
|
||||
case NC_EMAXVARS: return "NetCDF: NC_MAX_VARS exceeded";
|
||||
case NC_EMAXVARS: return "NetCDF: NC_MAX_VARS exceeded"; /* not enforced after 4.5.0 */
|
||||
case NC_ENOTVAR:
|
||||
return "NetCDF: Variable not found";
|
||||
case NC_EGLOBAL:
|
||||
|
@ -162,7 +162,7 @@ element of the dimids array.
|
||||
\returns ::NC_EBADID Bad ncid.
|
||||
\returns ::NC_ENOTINDEFINE Not in define mode.
|
||||
\returns ::NC_ESTRICTNC3 Attempting netcdf-4 operation on strict nc3 netcdf-4 file.
|
||||
\returns ::NC_EMAXVARS NC_MAX_VARS exceeded
|
||||
\returns ::NC_EMAXVARS NC_MAX_VARS exceeded [Not enforced after 4.5.0]
|
||||
\returns ::NC_EBADTYPE Bad type.
|
||||
\returns ::NC_EINVAL Invalid input.
|
||||
\returns ::NC_ENAMEINUSE Name already in use.
|
||||
|
@ -883,8 +883,6 @@ NC3_put_att(
|
||||
old = *attrpp;
|
||||
} else {
|
||||
if(!NC_indef(ncp)) return NC_ENOTINDEFINE;
|
||||
|
||||
if(ncap->nelems >= NC_MAX_ATTRS) return NC_EMAXATTS;
|
||||
}
|
||||
|
||||
status = NC_check_name(name);
|
||||
|
@ -363,9 +363,6 @@ NC3_def_dim(int ncid, const char *name, size_t size, int *dimidp)
|
||||
}
|
||||
}
|
||||
|
||||
if(ncp->dims.nelems >= NC_MAX_DIMS)
|
||||
return NC_EMAXDIMS;
|
||||
|
||||
dimid = NC_finddim(&ncp->dims, name, &dimp);
|
||||
if(dimid != -1)
|
||||
return NC_ENAMEINUSE;
|
||||
|
@ -609,11 +609,6 @@ NC3_def_var( int ncid, const char *name, nc_type type,
|
||||
return NC_EINVAL;
|
||||
}
|
||||
|
||||
if(ncp->vars.nelems >= NC_MAX_VARS)
|
||||
{
|
||||
return NC_EMAXVARS;
|
||||
}
|
||||
|
||||
varid = NC_findvar(&ncp->vars, name, &varp);
|
||||
if(varid != -1)
|
||||
{
|
||||
|
@ -81,14 +81,14 @@ TestFunc(strerror)(void)
|
||||
{NC_ENOTINDEFINE, "NetCDF: Operation not allowed in data mode"},
|
||||
{NC_EINDEFINE, "NetCDF: Operation not allowed in define mode"},
|
||||
{NC_EINVALCOORDS, "NetCDF: Index exceeds dimension bound"},
|
||||
{NC_EMAXDIMS, "NetCDF: NC_MAX_DIMS exceeded"},
|
||||
{NC_EMAXDIMS, "NetCDF: NC_MAX_DIMS exceeded"}, /* not enforced after 4.5.0 */
|
||||
{NC_ENAMEINUSE, "NetCDF: String match to name in use"},
|
||||
{NC_ENOTATT, "NetCDF: Attribute not found"},
|
||||
{NC_EMAXATTS, "NetCDF: NC_MAX_ATTRS exceeded"},
|
||||
{NC_EMAXATTS, "NetCDF: NC_MAX_ATTRS exceeded"}, /* not enforced after 4.5.0 */
|
||||
{NC_EBADTYPE, "NetCDF: Not a valid data type or _FillValue type mismatch"},
|
||||
{NC_EBADDIM, "NetCDF: Invalid dimension ID or name"},
|
||||
{NC_EUNLIMPOS, "NetCDF: NC_UNLIMITED in the wrong index"},
|
||||
{NC_EMAXVARS, "NetCDF: NC_MAX_VARS exceeded"},
|
||||
{NC_EMAXVARS, "NetCDF: NC_MAX_VARS exceeded"}, /* not enforced after 4.5.0 */
|
||||
{NC_ENOTVAR, "NetCDF: Variable not found"},
|
||||
{NC_EGLOBAL, "NetCDF: Action prohibited on NC_GLOBAL varid"},
|
||||
{NC_ENOTNC, "NetCDF: Unknown file format"},
|
||||
|
@ -1252,14 +1252,14 @@ char* nc_err_code_name(int err)
|
||||
case (NC_ENOTINDEFINE): return "NC_ENOTINDEFINE";
|
||||
case (NC_EINDEFINE): return "NC_EINDEFINE";
|
||||
case (NC_EINVALCOORDS): return "NC_EINVALCOORDS";
|
||||
case (NC_EMAXDIMS): return "NC_EMAXDIMS";
|
||||
case (NC_EMAXDIMS): return "NC_EMAXDIMS"; /* not enforced after 4.5.0 */
|
||||
case (NC_ENAMEINUSE): return "NC_ENAMEINUSE";
|
||||
case (NC_ENOTATT): return "NC_ENOTATT";
|
||||
case (NC_EMAXATTS): return "NC_EMAXATTS";
|
||||
case (NC_EMAXATTS): return "NC_EMAXATTS"; /* not enforced after 4.5.0 */
|
||||
case (NC_EBADTYPE): return "NC_EBADTYPE";
|
||||
case (NC_EBADDIM): return "NC_EBADDIM";
|
||||
case (NC_EUNLIMPOS): return "NC_EUNLIMPOS";
|
||||
case (NC_EMAXVARS): return "NC_EMAXVARS";
|
||||
case (NC_EMAXVARS): return "NC_EMAXVARS"; /* not enforced after 4.5.0 */
|
||||
case (NC_ENOTVAR): return "NC_ENOTVAR";
|
||||
case (NC_EGLOBAL): return "NC_EGLOBAL";
|
||||
case (NC_ENOTNC): return "NC_ENOTNC";
|
||||
|
Loading…
Reference in New Issue
Block a user