netCDF  4.2.1.1
/usr/src/RPM/BUILD/libnetcdf7-seq-4.2.1.1/libdispatch/dattput.c
Go to the documentation of this file.
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 
00222 int
00223 nc_put_att(int ncid, int varid, const char *name, nc_type xtype,
00224            size_t len, const void *value)
00225 {
00226    NC* ncp;
00227    int stat = NC_check_id(ncid, &ncp);
00228    if(stat != NC_NOERR) return stat;
00229    return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 
00230                                  value, xtype);
00231 }
00232 
00233 int
00234 nc_put_att_schar(int ncid, int varid, const char *name,
00235                  nc_type xtype, size_t len, const signed char *value)
00236 {
00237    NC *ncp;
00238    int stat = NC_check_id(ncid, &ncp);
00239    if(stat != NC_NOERR) return stat;
00240    return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 
00241                                  (void *)value, NC_BYTE);
00242 }
00243 
00244 int
00245 nc_put_att_uchar(int ncid, int varid, const char *name,
00246                  nc_type xtype, size_t len, const unsigned char *value)
00247 {
00248    NC* ncp;
00249    int stat = NC_check_id(ncid, &ncp);
00250    if(stat != NC_NOERR) return stat;
00251    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00252                                  (void *)value, NC_UBYTE);
00253 }
00254 
00255 int
00256 nc_put_att_short(int ncid, int varid, const char *name,
00257                  nc_type xtype, size_t len, const short *value)
00258 {
00259    NC* ncp;
00260    int stat = NC_check_id(ncid, &ncp);
00261    if(stat != NC_NOERR) return stat;
00262    return ncp->dispatch->put_att(ncid, varid, name, xtype, len, 
00263                                  (void *)value, NC_SHORT);
00264 }
00265 
00266 int
00267 nc_put_att_int(int ncid, int varid, const char *name,
00268                nc_type xtype, size_t len, const int *value)
00269 {
00270    NC* ncp;
00271    int stat = NC_check_id(ncid, &ncp);
00272    if(stat != NC_NOERR) return stat;
00273    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00274                                  (void *)value, NC_INT);
00275 }
00276 
00277 int
00278 nc_put_att_long(int ncid, int varid, const char *name,
00279                 nc_type xtype, size_t len, const long *value)
00280 {
00281    NC* ncp;
00282    int stat = NC_check_id(ncid, &ncp);
00283    if(stat != NC_NOERR) return stat;
00284    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00285                                  (void *)value, longtype);
00286 }
00287 
00288 int
00289 nc_put_att_float(int ncid, int varid, const char *name,
00290                  nc_type xtype, size_t len, const float *value)
00291 {
00292    NC* ncp;
00293    int stat = NC_check_id(ncid, &ncp);
00294    if(stat != NC_NOERR) return stat;
00295    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00296                                  (void *)value, NC_FLOAT);
00297 }
00298 
00299 int
00300 nc_put_att_double(int ncid, int varid, const char *name,
00301                   nc_type xtype, size_t len, const double *value)
00302 {
00303    NC* ncp;
00304    int stat = NC_check_id(ncid, &ncp);
00305    if(stat != NC_NOERR) return stat;
00306    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00307                                  (void *)value, NC_DOUBLE);
00308 }
00309 
00310 int
00311 nc_put_att_ubyte(int ncid, int varid, const char *name,
00312                  nc_type xtype, size_t len, const unsigned char *value)
00313 {
00314    NC* ncp;
00315    int stat = NC_check_id(ncid, &ncp);
00316    if(stat != NC_NOERR) return stat;
00317    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00318                                  (void *)value, NC_UBYTE);
00319 }
00320 
00321 int
00322 nc_put_att_ushort(int ncid, int varid, const char *name,
00323                   nc_type xtype, size_t len, const unsigned short *value)
00324 {
00325    NC* ncp;
00326    int stat = NC_check_id(ncid, &ncp);
00327    if(stat != NC_NOERR) return stat;
00328    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00329                                  (void *)value, NC_USHORT);
00330 }
00331 
00332 int
00333 nc_put_att_uint(int ncid, int varid, const char *name,
00334                 nc_type xtype, size_t len, const unsigned int *value)
00335 {
00336    NC* ncp;
00337    int stat = NC_check_id(ncid, &ncp);
00338    if(stat != NC_NOERR) return stat;
00339    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00340                                  (void *)value, NC_UINT);
00341 }
00342 
00343 int
00344 nc_put_att_longlong(int ncid, int varid, const char *name,
00345                     nc_type xtype, size_t len, 
00346                     const long long *value)
00347 {
00348    NC* ncp;
00349    int stat = NC_check_id(ncid, &ncp);
00350    if(stat != NC_NOERR) return stat;
00351    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00352                                  (void *)value, NC_INT64);
00353 }
00354 
00355 int
00356 nc_put_att_ulonglong(int ncid, int varid, const char *name,
00357                      nc_type xtype, size_t len, 
00358                      const unsigned long long *value)
00359 {
00360    NC* ncp;
00361    int stat = NC_check_id(ncid, &ncp);
00362    if(stat != NC_NOERR) return stat;
00363    return ncp->dispatch->put_att(ncid, varid, name, xtype, len,
00364                                  (void *)value, NC_UINT64);
00365 }
00366 
 All Data Structures Files Functions Variables Typedefs Defines

Generated on Sat Sep 15 2012 12:44:33 for netCDF. NetCDF is a Unidata library.