NetCDF
4.3.2
|
00001 00009 #include "ncdispatch.h" 00010 00047 int 00048 nc_put_att_string(int ncid, int varid, const char *name, 00049 size_t len, const char** value) 00050 { 00051 NC* ncp; 00052 int stat = NC_check_id(ncid, &ncp); 00053 if(stat != NC_NOERR) return stat; 00054 return ncp->dispatch->put_att(ncid, varid, name, NC_STRING, 00055 len, (void*)value, NC_STRING); 00056 } 00057 00134 int 00135 nc_put_att_text(int ncid, int varid, const char *name, 00136 size_t len, const char *value) 00137 { 00138 NC* ncp; 00139 int stat = NC_check_id(ncid, &ncp); 00140 if(stat != NC_NOERR) return stat; 00141 return ncp->dispatch->put_att(ncid, varid, name, NC_CHAR, len, 00142 (void *)value, NC_CHAR); 00143 } 00144 00225 int 00226 nc_put_att(int ncid, int varid, const char *name, nc_type xtype, 00227 size_t len, const void *value) 00228 { 00229 NC* ncp; 00230 int stat = NC_check_id(ncid, &ncp); 00231 if(stat != NC_NOERR) return stat; 00232 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00233 value, xtype); 00234 } 00235 00236 int 00237 nc_put_att_schar(int ncid, int varid, const char *name, 00238 nc_type xtype, size_t len, const signed char *value) 00239 { 00240 NC *ncp; 00241 int stat = NC_check_id(ncid, &ncp); 00242 if(stat != NC_NOERR) return stat; 00243 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00244 (void *)value, NC_BYTE); 00245 } 00246 00247 int 00248 nc_put_att_uchar(int ncid, int varid, const char *name, 00249 nc_type xtype, size_t len, const unsigned char *value) 00250 { 00251 NC* ncp; 00252 int stat = NC_check_id(ncid, &ncp); 00253 if(stat != NC_NOERR) return stat; 00254 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00255 (void *)value, NC_UBYTE); 00256 } 00257 00258 int 00259 nc_put_att_short(int ncid, int varid, const char *name, 00260 nc_type xtype, size_t len, const short *value) 00261 { 00262 NC* ncp; 00263 int stat = NC_check_id(ncid, &ncp); 00264 if(stat != NC_NOERR) return stat; 00265 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00266 (void *)value, NC_SHORT); 00267 } 00268 00269 int 00270 nc_put_att_int(int ncid, int varid, const char *name, 00271 nc_type xtype, size_t len, const int *value) 00272 { 00273 NC* ncp; 00274 int stat = NC_check_id(ncid, &ncp); 00275 if(stat != NC_NOERR) return stat; 00276 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00277 (void *)value, NC_INT); 00278 } 00279 00280 int 00281 nc_put_att_long(int ncid, int varid, const char *name, 00282 nc_type xtype, size_t len, const long *value) 00283 { 00284 NC* ncp; 00285 int stat = NC_check_id(ncid, &ncp); 00286 if(stat != NC_NOERR) return stat; 00287 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00288 (void *)value, longtype); 00289 } 00290 00291 int 00292 nc_put_att_float(int ncid, int varid, const char *name, 00293 nc_type xtype, size_t len, const float *value) 00294 { 00295 NC* ncp; 00296 int stat = NC_check_id(ncid, &ncp); 00297 if(stat != NC_NOERR) return stat; 00298 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00299 (void *)value, NC_FLOAT); 00300 } 00301 00302 int 00303 nc_put_att_double(int ncid, int varid, const char *name, 00304 nc_type xtype, size_t len, const double *value) 00305 { 00306 NC* ncp; 00307 int stat = NC_check_id(ncid, &ncp); 00308 if(stat != NC_NOERR) return stat; 00309 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00310 (void *)value, NC_DOUBLE); 00311 } 00312 00313 int 00314 nc_put_att_ubyte(int ncid, int varid, const char *name, 00315 nc_type xtype, size_t len, const unsigned char *value) 00316 { 00317 NC* ncp; 00318 int stat = NC_check_id(ncid, &ncp); 00319 if(stat != NC_NOERR) return stat; 00320 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00321 (void *)value, NC_UBYTE); 00322 } 00323 00324 int 00325 nc_put_att_ushort(int ncid, int varid, const char *name, 00326 nc_type xtype, size_t len, const unsigned short *value) 00327 { 00328 NC* ncp; 00329 int stat = NC_check_id(ncid, &ncp); 00330 if(stat != NC_NOERR) return stat; 00331 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00332 (void *)value, NC_USHORT); 00333 } 00334 00335 int 00336 nc_put_att_uint(int ncid, int varid, const char *name, 00337 nc_type xtype, size_t len, const unsigned int *value) 00338 { 00339 NC* ncp; 00340 int stat = NC_check_id(ncid, &ncp); 00341 if(stat != NC_NOERR) return stat; 00342 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00343 (void *)value, NC_UINT); 00344 } 00345 00346 int 00347 nc_put_att_longlong(int ncid, int varid, const char *name, 00348 nc_type xtype, size_t len, 00349 const long long *value) 00350 { 00351 NC* ncp; 00352 int stat = NC_check_id(ncid, &ncp); 00353 if(stat != NC_NOERR) return stat; 00354 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00355 (void *)value, NC_INT64); 00356 } 00357 00358 int 00359 nc_put_att_ulonglong(int ncid, int varid, const char *name, 00360 nc_type xtype, size_t len, 00361 const unsigned long long *value) 00362 { 00363 NC* ncp; 00364 int stat = NC_check_id(ncid, &ncp); 00365 if(stat != NC_NOERR) return stat; 00366 return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 00367 (void *)value, NC_UINT64); 00368 } 00369