NetCDF  4.9.2
dcompound.c
Go to the documentation of this file.
1 
7 #include "ncdispatch.h"
8  /* All these functions are part of this named group... */
12 
13 
62 int
63 nc_def_compound(int ncid, size_t size, const char *name,
64  nc_type *typeidp)
65 {
66  NC* ncp;
67  int stat = NC_check_id(ncid,&ncp);
68  if(stat != NC_NOERR) return stat;
69  return ncp->dispatch->def_compound(ncid,size,name,typeidp);
70 }
71 
98 int
99 nc_insert_compound(int ncid, nc_type xtype, const char *name,
100  size_t offset, nc_type field_typeid)
101 {
102  NC *ncp;
103  int stat = NC_check_id(ncid, &ncp);
104  if(stat != NC_NOERR) return stat;
105  return ncp->dispatch->insert_compound(ncid, xtype, name,
106  offset, field_typeid);
107 }
108 
140 int
141 nc_insert_array_compound(int ncid, nc_type xtype, const char *name,
142  size_t offset, nc_type field_typeid,
143  int ndims, const int *dim_sizes)
144 {
145  NC* ncp;
146  int stat = NC_check_id(ncid,&ncp);
147  if(stat != NC_NOERR) return stat;
148  return ncp->dispatch->insert_array_compound(ncid,xtype,name,offset,field_typeid,ndims,dim_sizes);
149 }
150 
174 int
175 nc_inq_compound(int ncid, nc_type xtype, char *name,
176  size_t *sizep, size_t *nfieldsp)
177 {
178  int class = 0;
179  int stat = nc_inq_user_type(ncid,xtype,name,sizep,NULL,nfieldsp,&class);
180  if(stat != NC_NOERR) return stat;
181  if(class != NC_COMPOUND) stat = NC_EBADTYPE;
182  return stat;
183 }
184 
202 int
203 nc_inq_compound_name(int ncid, nc_type xtype, char *name)
204 {
205  return nc_inq_compound(ncid,xtype,name,NULL,NULL);
206 }
207 
225 int
226 nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep)
227 {
228  return nc_inq_compound(ncid,xtype,NULL,sizep,NULL);
229 }
230 
248 int
249 nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp)
250 {
251  return nc_inq_compound(ncid,xtype,NULL,NULL,nfieldsp);
252 }
253 
286 int
287 nc_inq_compound_field(int ncid, nc_type xtype, int fieldid,
288  char *name, size_t *offsetp,
289  nc_type *field_typeidp, int *ndimsp,
290  int *dim_sizesp)
291 {
292  NC* ncp;
293  int stat = NC_check_id(ncid,&ncp);
294  if(stat != NC_NOERR) return stat;
295  return ncp->dispatch->inq_compound_field(ncid, xtype, fieldid,
296  name, offsetp, field_typeidp,
297  ndimsp, dim_sizesp);
298 }
299 
320 int
321 nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid,
322  char *name)
323 {
324  NC* ncp;
325  int stat = NC_check_id(ncid,&ncp);
326  if(stat != NC_NOERR) return stat;
327  return ncp->dispatch->inq_compound_field(ncid, xtype, fieldid,
328  name, NULL, NULL, NULL,
329  NULL);
330 }
331 
352 int
353 nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid,
354  size_t *offsetp)
355 {
356  NC* ncp;
357  int stat = NC_check_id(ncid,&ncp);
358  if(stat != NC_NOERR) return stat;
359  return ncp->dispatch->inq_compound_field(ncid,xtype,fieldid,NULL,offsetp,NULL,NULL,NULL);
360 }
361 
382 int
383 nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid,
384  nc_type *field_typeidp)
385 {
386  NC* ncp;
387  int stat = NC_check_id(ncid,&ncp);
388  if(stat != NC_NOERR) return stat;
389  return ncp->dispatch->inq_compound_field(ncid,xtype,fieldid,NULL,NULL,field_typeidp,NULL,NULL);
390 }
391 
412 int
413 nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid,
414  int *ndimsp)
415 {
416  NC* ncp;
417  int stat = NC_check_id(ncid,&ncp);
418  if(stat != NC_NOERR) return stat;
419  return ncp->dispatch->inq_compound_field(ncid,xtype,fieldid,NULL,NULL,NULL,ndimsp,NULL);
420 }
421 
442 int
443 nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid,
444  int *dim_sizesp)
445 {
446  NC *ncp;
447  int stat = NC_check_id(ncid, &ncp);
448  if(stat != NC_NOERR) return stat;
449  return ncp->dispatch->inq_compound_field(ncid, xtype, fieldid,
450  NULL, NULL, NULL, NULL,
451  dim_sizesp);
452 }
453 
474 int
475 nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name,
476  int *fieldidp)
477 {
478  NC* ncp;
479  int stat = NC_check_id(ncid,&ncp);
480  if(stat != NC_NOERR) return stat;
481  return ncp->dispatch->inq_compound_fieldindex(ncid,xtype,name,fieldidp);
482 } /* End of named group ...*/
int nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, nc_type *field_typeidp)
Get information about one of the fields of a compound type.
Definition: dcompound.c:383
int nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, size_t *nfieldsp)
Learn about a compound type.
Definition: dcompound.c:175
int nc_insert_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid)
Insert a named field into a compound type.
Definition: dcompound.c:99
int nc_inq_compound_name(int ncid, nc_type xtype, char *name)
Learn the name of a compound type.
Definition: dcompound.c:203
int nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type *field_typeidp, int *ndimsp, int *dim_sizesp)
Get information about one of the fields of a compound type.
Definition: dcompound.c:287
int nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, int *dim_sizesp)
Get information about one of the fields of a compound type.
Definition: dcompound.c:443
int nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp)
Create a compound type.
Definition: dcompound.c:63
int nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, int *fieldidp)
Learn the Index of a Named Field in a Compound Type.
Definition: dcompound.c:475
int nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, int *ndimsp)
Get information about one of the fields of a compound type.
Definition: dcompound.c:413
int nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp)
Learn the number of fields in a compound type.
Definition: dcompound.c:249
int nc_insert_array_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid, int ndims, const int *dim_sizes)
Insert a named array field into a compound type.
Definition: dcompound.c:141
int nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, size_t *offsetp)
Get information about one of the fields of a compound type.
Definition: dcompound.c:353
int nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, char *name)
Get information about one of the fields of a compound type.
Definition: dcompound.c:321
int nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep)
Learn the size of a compound type.
Definition: dcompound.c:226
EXTERNL int nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, nc_type *base_nc_typep, size_t *nfieldsp, int *classp)
Learn about a user defined type.
Definition: dtype.c:146
#define NC_EBADTYPE
Not a netcdf data type.
Definition: netcdf.h:410
#define NC_COMPOUND
compound types
Definition: netcdf.h:56
#define NC_NOERR
No Error.
Definition: netcdf.h:368
int nc_type
The nc_type type is just an int.
Definition: netcdf.h:25