Loading...
Searching...
No Matches
dvlen.c
Go to the documentation of this file.
#include "ncdispatch.h"
/* All these functions are part of this named group... */
int
nc_free_vlens(size_t nelems, nc_vlen_t vlens[])
{
int ret;
size_t i;
for(i = 0; i < nelems; i++)
if ((ret = nc_free_vlen(&vlens[i])))
return ret;
return NC_NOERR;
}
int
nc_free_vlen(nc_vlen_t *vl)
{
free(vl->p);
return NC_NOERR;
}
int
nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->def_vlen(ncid,name,base_typeid,xtypep);
}
int
nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type *base_nc_typep)
{
int class = 0;
int stat = nc_inq_user_type(ncid,xtype,name,datum_sizep,base_nc_typep,NULL,&class);
if(stat != NC_NOERR) return stat;
if(class != NC_VLEN) stat = NC_EBADTYPE;
return stat;
}
/* End of named group ...*/
int
nc_put_vlen_element(int ncid, int typeid1, void *vlen_element, size_t len, const void *data)
{
NC* ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->put_vlen_element(ncid,typeid1,vlen_element,len,data);
}
int
nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element,
size_t *len, void *data)
{
NC *ncp;
int stat = NC_check_id(ncid,&ncp);
if(stat != NC_NOERR) return stat;
return ncp->dispatch->get_vlen_element(ncid, typeid1, vlen_element,
len, data);
}
nc_def_vlen
int nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep)
Use this function to define a variable length array type.
Definition dvlen.c:93
nc_free_vlen
int nc_free_vlen(nc_vlen_t *vl)
Free memory in a single VLEN object.
Definition dvlen.c:61
nc_inq_vlen
int nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type *base_nc_typep)
Learn about a VLEN type.
Definition dvlen.c:121
nc_free_vlens
int nc_free_vlens(size_t nelems, nc_vlen_t vlens[])
Free an array of vlens given the number of elements and an array.
Definition dvlen.c:40
nc_inq_user_type
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
NC_EBADTYPE
#define NC_EBADTYPE
Not a netcdf data type.
Definition netcdf.h:459
nc_vlen_t::p
void * p
Pointer to VL data.
Definition netcdf.h:852
NC_VLEN
#define NC_VLEN
vlen (variable-length) types
Definition netcdf.h:53
NC_NOERR
#define NC_NOERR
No Error.
Definition netcdf.h:417
nc_type
int nc_type
The nc_type type is just an int.
Definition netcdf.h:25
nc_vlen_t
This is the type of arrays of vlens.
Definition netcdf.h:850