123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- #include "ncdispatch.h"
-
- int
- nc_free_vlen(nc_vlen_t *vl)
- {
- free(vl->p);
- return NC_NOERR;
- }
-
- int
- nc_free_vlens(size_t len, nc_vlen_t vlens[])
- {
- int ret;
- size_t i;
- for(i = 0; i < len; i++)
- if ((ret = nc_free_vlen(&vlens[i])))
- return ret;
- 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;
- }
-
- 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);
- }
|