/* This is part of the netCDF package. Copyright 2005 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. See www.unidata.ucar.edu for more info. Test netcdf-4 variable length code. $Id: tst_vl.c,v 1.30 2009/10/26 22:07:16 ed Exp $ */ #include #include "err_macros.h" #include "netcdf.h" #define FILE_NAME "tst_vl.nc" #define FILE_NAME2 "tst_vl_2.nc" #define DIM_LEN 3 #define VLEN_NAME "vlen_name" #define ATT_NAME "att_name" #define DIM_NAME "dim" #define VAR_NAME "var" #define PHONY_VAL -99 /* Use this struct to hold vlen data: */ /* typedef struct { */ /* size_t len; Length of VL data (in base type units) */ /* void *p; Pointer to VL data */ /* } hvl_t; */ int main(int argc, char **argv) { printf("\n*** Testing netcdf-4 variable length type functions.\n"); printf("*** testing vlen (of ints) attribute..."); { int ncid, typeid; nc_vlen_t data[DIM_LEN], data_in[DIM_LEN]; size_t size_in; nc_type base_nc_type_in; char name_in[NC_MAX_NAME + 1]; int *phony, class_in; size_t len_in; int i, j; /* Create phony data. */ for (i=0; i