mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-03-13 17:18:08 +08:00
Merge branch 'global_fill' of https://github.com/wkliao/netcdf-c into ghpull-388
This commit is contained in:
commit
5871f3ad0c
@ -37,7 +37,8 @@ apply.
|
||||
\param value Pointer to one or more values.
|
||||
|
||||
\returns ::NC_NOERR No error.
|
||||
\returns ::NC_EINVAL More than one value for _FillValue or trying to set global _FillValue.
|
||||
\returns ::NC_EINVAL More than one value for _FillValue.
|
||||
\returns ::NC_EGLOBAL Trying to set global _FillValue.
|
||||
\returns ::NC_ENOTVAR Couldn't find varid.
|
||||
\returns ::NC_EBADTYPE Fill value and var must be same type.
|
||||
\returns ::NC_ENOMEM Out of memory
|
||||
@ -53,6 +54,9 @@ nc_put_att_string(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, NC_STRING,
|
||||
len, (void*)value, NC_STRING);
|
||||
}
|
||||
@ -87,7 +91,8 @@ apply.
|
||||
\param value Pointer to one or more values.
|
||||
|
||||
\returns ::NC_NOERR No error.
|
||||
\returns ::NC_EINVAL More than one value for _FillValue or trying to set global _FillValue.
|
||||
\returns ::NC_EINVAL More than one value for _FillValue.
|
||||
\returns ::NC_EGLOBAL Trying to set global _FillValue.
|
||||
\returns ::NC_ENOTVAR Couldn't find varid.
|
||||
\returns ::NC_EBADTYPE Fill value and var must be same type.
|
||||
\returns ::NC_ENOMEM Out of memory
|
||||
@ -141,6 +146,9 @@ int nc_put_att_text(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, NC_CHAR, len,
|
||||
(void *)value, NC_CHAR);
|
||||
}
|
||||
@ -182,7 +190,8 @@ apply.
|
||||
\param value Pointer to one or more values.
|
||||
|
||||
\returns ::NC_NOERR No error.
|
||||
\returns ::NC_EINVAL More than one value for _FillValue or trying to set global _FillValue.
|
||||
\returns ::NC_EINVAL More than one value for _FillValue.
|
||||
\returns ::NC_EGLOBAL Trying to set global _FillValue.
|
||||
\returns ::NC_ENOTVAR Couldn't find varid.
|
||||
\returns ::NC_EBADTYPE Fill value and var must be same type.
|
||||
\returns ::NC_ENOMEM Out of memory
|
||||
@ -232,6 +241,9 @@ nc_put_att(int ncid, int varid, const char *name, nc_type xtype,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
value, xtype);
|
||||
}
|
||||
@ -243,6 +255,9 @@ nc_put_att_schar(int ncid, int varid, const char *name,
|
||||
NC *ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_BYTE);
|
||||
}
|
||||
@ -254,6 +269,9 @@ nc_put_att_uchar(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_UBYTE);
|
||||
}
|
||||
@ -265,6 +283,9 @@ nc_put_att_short(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_SHORT);
|
||||
}
|
||||
@ -276,6 +297,9 @@ nc_put_att_int(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_INT);
|
||||
}
|
||||
@ -287,6 +311,9 @@ nc_put_att_long(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, longtype);
|
||||
}
|
||||
@ -298,6 +325,9 @@ nc_put_att_float(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_FLOAT);
|
||||
}
|
||||
@ -309,6 +339,9 @@ nc_put_att_double(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_DOUBLE);
|
||||
}
|
||||
@ -320,6 +353,9 @@ nc_put_att_ubyte(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_UBYTE);
|
||||
}
|
||||
@ -331,6 +367,9 @@ nc_put_att_ushort(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_USHORT);
|
||||
}
|
||||
@ -342,6 +381,9 @@ nc_put_att_uint(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_UINT);
|
||||
}
|
||||
@ -354,6 +396,9 @@ nc_put_att_longlong(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_INT64);
|
||||
}
|
||||
@ -366,6 +411,9 @@ nc_put_att_ulonglong(int ncid, int varid, const char *name,
|
||||
NC* ncp;
|
||||
int stat = NC_check_id(ncid, &ncp);
|
||||
if(stat != NC_NOERR) return stat;
|
||||
/* set global _FillValue is not allowed */
|
||||
if (varid == NC_GLOBAL && name != NULL && !strcmp(name, _FillValue))
|
||||
return NC_EGLOBAL;
|
||||
return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
|
||||
(void *)value, NC_UINT64);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user