NetCDF
4.3.2
|
00001 00007 #include "ncdispatch.h" 00008 /* All these functions are part of this named group... */ 00012 00013 00062 int 00063 nc_def_compound(int ncid, size_t size, const char *name, 00064 nc_type *typeidp) 00065 { 00066 NC* ncp; 00067 int stat = NC_check_id(ncid,&ncp); 00068 if(stat != NC_NOERR) return stat; 00069 return ncp->dispatch->def_compound(ncid,size,name,typeidp); 00070 } 00071 00098 int 00099 nc_insert_compound(int ncid, nc_type xtype, const char *name, 00100 size_t offset, nc_type field_typeid) 00101 { 00102 NC *ncp; 00103 int stat = NC_check_id(ncid, &ncp); 00104 if(stat != NC_NOERR) return stat; 00105 return ncp->dispatch->insert_compound(ncid, xtype, name, 00106 offset, field_typeid); 00107 } 00108 00140 int 00141 nc_insert_array_compound(int ncid, nc_type xtype, const char *name, 00142 size_t offset, nc_type field_typeid, 00143 int ndims, const int *dim_sizes) 00144 { 00145 NC* ncp; 00146 int stat = NC_check_id(ncid,&ncp); 00147 if(stat != NC_NOERR) return stat; 00148 return ncp->dispatch->insert_array_compound(ncid,xtype,name,offset,field_typeid,ndims,dim_sizes); 00149 } 00150 00174 int 00175 nc_inq_compound(int ncid, nc_type xtype, char *name, 00176 size_t *sizep, size_t *nfieldsp) 00177 { 00178 int class = 0; 00179 int stat = nc_inq_user_type(ncid,xtype,name,sizep,NULL,nfieldsp,&class); 00180 if(stat != NC_NOERR) return stat; 00181 if(class != NC_COMPOUND) stat = NC_EBADTYPE; 00182 return stat; 00183 } 00184 00202 int 00203 nc_inq_compound_name(int ncid, nc_type xtype, char *name) 00204 { 00205 return nc_inq_compound(ncid,xtype,name,NULL,NULL); 00206 } 00207 00225 int 00226 nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep) 00227 { 00228 return nc_inq_compound(ncid,xtype,NULL,sizep,NULL); 00229 } 00230 00248 int 00249 nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp) 00250 { 00251 return nc_inq_compound(ncid,xtype,NULL,NULL,nfieldsp); 00252 } 00253 00286 int 00287 nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, 00288 char *name, size_t *offsetp, 00289 nc_type *field_typeidp, int *ndimsp, 00290 int *dim_sizesp) 00291 { 00292 NC* ncp; 00293 int stat = NC_check_id(ncid,&ncp); 00294 if(stat != NC_NOERR) return stat; 00295 return ncp->dispatch->inq_compound_field(ncid, xtype, fieldid, 00296 name, offsetp, field_typeidp, 00297 ndimsp, dim_sizesp); 00298 } 00299 00320 int 00321 nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, 00322 char *name) 00323 { 00324 NC* ncp; 00325 int stat = NC_check_id(ncid,&ncp); 00326 if(stat != NC_NOERR) return stat; 00327 return ncp->dispatch->inq_compound_field(ncid, xtype, fieldid, 00328 name, NULL, NULL, NULL, 00329 NULL); 00330 } 00331 00352 int 00353 nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, 00354 size_t *offsetp) 00355 { 00356 NC* ncp; 00357 int stat = NC_check_id(ncid,&ncp); 00358 if(stat != NC_NOERR) return stat; 00359 return ncp->dispatch->inq_compound_field(ncid,xtype,fieldid,NULL,offsetp,NULL,NULL,NULL); 00360 } 00361 00382 int 00383 nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, 00384 nc_type *field_typeidp) 00385 { 00386 NC* ncp; 00387 int stat = NC_check_id(ncid,&ncp); 00388 if(stat != NC_NOERR) return stat; 00389 return ncp->dispatch->inq_compound_field(ncid,xtype,fieldid,NULL,NULL,field_typeidp,NULL,NULL); 00390 } 00391 00412 int 00413 nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, 00414 int *ndimsp) 00415 { 00416 NC* ncp; 00417 int stat = NC_check_id(ncid,&ncp); 00418 if(stat != NC_NOERR) return stat; 00419 return ncp->dispatch->inq_compound_field(ncid,xtype,fieldid,NULL,NULL,NULL,ndimsp,NULL); 00420 } 00421 00442 int 00443 nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, 00444 int *dim_sizesp) 00445 { 00446 NC *ncp; 00447 int stat = NC_check_id(ncid, &ncp); 00448 if(stat != NC_NOERR) return stat; 00449 return ncp->dispatch->inq_compound_field(ncid, xtype, fieldid, 00450 NULL, NULL, NULL, NULL, 00451 dim_sizesp); 00452 } 00453 00474 int 00475 nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, 00476 int *fieldidp) 00477 { 00478 NC* ncp; 00479 int stat = NC_check_id(ncid,&ncp); 00480 if(stat != NC_NOERR) return stat; 00481 return ncp->dispatch->inq_compound_fieldindex(ncid,xtype,name,fieldidp); 00482 } /* End of named group ...*/ 00484 00485 00486 00487 00488 00489