NetCDF
4.3.2
|
00001 00009 #include "ncdispatch.h" 00010 00040 int 00041 nc_get_att(int ncid, int varid, const char *name, void *value) 00042 { 00043 NC* ncp; 00044 int stat = NC_NOERR; 00045 nc_type xtype; 00046 00047 if ((stat = NC_check_id(ncid, &ncp))) 00048 return stat; 00049 00050 /* Need to get the type */ 00051 if ((stat = nc_inq_atttype(ncid, varid, name, &xtype))) 00052 return stat; 00053 00054 return ncp->dispatch->get_att(ncid, varid, name, value, xtype); 00055 } 00131 int 00132 nc_get_att_text(int ncid, int varid, const char *name, char *value) 00133 { 00134 NC* ncp; 00135 int stat = NC_check_id(ncid, &ncp); 00136 if(stat != NC_NOERR) return stat; 00137 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_CHAR); 00138 } 00139 00140 int 00141 nc_get_att_schar(int ncid, int varid, const char *name, signed char *value) 00142 { 00143 NC* ncp; 00144 int stat = NC_check_id(ncid, &ncp); 00145 if(stat != NC_NOERR) return stat; 00146 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_BYTE); 00147 } 00148 00149 int 00150 nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *value) 00151 { 00152 NC* ncp; 00153 int stat = NC_check_id(ncid, &ncp); 00154 if(stat != NC_NOERR) return stat; 00155 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UBYTE); 00156 } 00157 00158 int 00159 nc_get_att_short(int ncid, int varid, const char *name, short *value) 00160 { 00161 NC* ncp; 00162 int stat = NC_check_id(ncid, &ncp); 00163 if(stat != NC_NOERR) return stat; 00164 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_SHORT); 00165 } 00166 00167 int 00168 nc_get_att_int(int ncid, int varid, const char *name, int *value) 00169 { 00170 NC* ncp; 00171 int stat = NC_check_id(ncid, &ncp); 00172 if(stat != NC_NOERR) return stat; 00173 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_INT); 00174 } 00175 00176 int 00177 nc_get_att_long(int ncid, int varid, const char *name, long *value) 00178 { 00179 NC* ncp; 00180 int stat = NC_check_id(ncid, &ncp); 00181 if(stat != NC_NOERR) return stat; 00182 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, longtype); 00183 } 00184 00185 int 00186 nc_get_att_float(int ncid, int varid, const char *name, float *value) 00187 { 00188 NC* ncp; 00189 int stat = NC_check_id(ncid, &ncp); 00190 if(stat != NC_NOERR) return stat; 00191 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_FLOAT); 00192 } 00193 00194 int 00195 nc_get_att_double(int ncid, int varid, const char *name, double *value) 00196 { 00197 NC* ncp; 00198 int stat = NC_check_id(ncid, &ncp); 00199 if(stat != NC_NOERR) return stat; 00200 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_DOUBLE); 00201 } 00202 00203 int 00204 nc_get_att_ubyte(int ncid, int varid, const char *name, unsigned char *value) 00205 { 00206 NC* ncp; 00207 int stat = NC_check_id(ncid, &ncp); 00208 if(stat != NC_NOERR) return stat; 00209 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UBYTE); 00210 } 00211 00212 int 00213 nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *value) 00214 { 00215 NC* ncp; 00216 int stat = NC_check_id(ncid, &ncp); 00217 if(stat != NC_NOERR) return stat; 00218 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_USHORT); 00219 } 00220 00221 int 00222 nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *value) 00223 { 00224 NC* ncp; 00225 int stat = NC_check_id(ncid, &ncp); 00226 if(stat != NC_NOERR) return stat; 00227 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UINT); 00228 } 00229 00230 int 00231 nc_get_att_longlong(int ncid, int varid, const char *name, long long *value) 00232 { 00233 NC* ncp; 00234 int stat = NC_check_id(ncid, &ncp); 00235 if(stat != NC_NOERR) return stat; 00236 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_INT64); 00237 } 00238 00239 int 00240 nc_get_att_ulonglong(int ncid, int varid, const char *name, unsigned long long *value) 00241 { 00242 NC *ncp; 00243 int stat = NC_check_id(ncid, &ncp); 00244 if(stat != NC_NOERR) return stat; 00245 return ncp->dispatch->get_att(ncid, varid, name, (void *)value, NC_UINT64); 00246 } 00247 00248 int 00249 nc_get_att_string(int ncid, int varid, const char *name, 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->get_att(ncid,varid,name,(void*)value, NC_STRING); 00255 }