2010-06-03 21:24:43 +08:00
|
|
|
#ifndef NC_NCGEN_H
|
|
|
|
#define NC_NCGEN_H
|
|
|
|
/*********************************************************************
|
2018-12-07 06:42:41 +08:00
|
|
|
* Copyright 2018, UCAR/Unidata
|
2010-06-03 21:24:43 +08:00
|
|
|
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
|
|
|
|
* $Header: /upc/share/CVS/netcdf-3/ncgen3/ncgen.h,v 1.8 1997/07/07 18:27:04 russ Exp $
|
|
|
|
*********************************************************************/
|
|
|
|
|
2023-12-01 01:16:54 +08:00
|
|
|
#include <stddef.h>
|
2010-06-03 21:24:43 +08:00
|
|
|
#define MAX_NC_ATTSIZE 20000 /* max size of attribute (for ncgen) */
|
|
|
|
#define MAXTRST 5000 /* max size of string value (for ncgen) */
|
|
|
|
|
2013-12-01 13:20:28 +08:00
|
|
|
#include "config.h"
|
2010-06-03 21:24:43 +08:00
|
|
|
#include "generic.h"
|
|
|
|
|
2022-01-25 06:01:23 +08:00
|
|
|
#ifndef nulldup
|
|
|
|
#define nulldup(x) ((x)?strdup(x):(x))
|
|
|
|
#endif
|
|
|
|
|
2010-06-03 21:24:43 +08:00
|
|
|
extern int ncid; /* handle for netCDF */
|
|
|
|
extern int ndims; /* number of dimensions declared for netcdf */
|
|
|
|
extern int nvars; /* number of variables declared for netcdf */
|
|
|
|
extern int natts; /* number of attributes */
|
|
|
|
extern int nvdims; /* number of dimensions for variables */
|
|
|
|
extern int dimnum; /* dimension number index for variables */
|
|
|
|
extern int varnum; /* variable number index for attributes */
|
2023-12-01 01:16:54 +08:00
|
|
|
extern size_t valnum; /* number of values specified for variable */
|
2010-06-03 21:24:43 +08:00
|
|
|
extern int rec_dim; /* number of the unlimited dimension, if any */
|
|
|
|
extern size_t rec_len; /* number of elements for a record of data */
|
|
|
|
extern size_t var_len; /* variable length (product of dimensions) */
|
|
|
|
extern size_t var_size; /* size of each element of variable */
|
|
|
|
|
|
|
|
extern struct dims {
|
|
|
|
size_t size;
|
|
|
|
char *name;
|
|
|
|
char *lname; /* with no "-" characters, for C and Fortran */
|
|
|
|
} *dims; /* table of dimensions */
|
|
|
|
|
|
|
|
extern struct vars {
|
|
|
|
char *name;
|
|
|
|
nc_type type;
|
|
|
|
int ndims;
|
|
|
|
int *dims; /* array of dimension ids */
|
|
|
|
union generic fill_value; /* set to value of _FillValue attribute */
|
|
|
|
int has_data; /* 1 if data specified, 0 otherwise */
|
|
|
|
size_t nrecs; /* for record variables, number of records
|
|
|
|
* of data in CDL */
|
|
|
|
char *data_stmnt; /* for record variables, to avoid
|
|
|
|
* two passes with -f option */
|
|
|
|
char *lname; /* with no "-" characters, for C and Fortran */
|
|
|
|
} *vars; /* table of variables */
|
|
|
|
|
|
|
|
|
|
|
|
extern struct atts {
|
|
|
|
int var; /* number of variable for this attribute */
|
|
|
|
char *name;
|
|
|
|
nc_type type;
|
|
|
|
size_t len;
|
|
|
|
void *val;
|
|
|
|
char *lname; /* with no "-" characters, for C and Fortran */
|
|
|
|
} *atts; /* table of variable and global attributes */
|
|
|
|
#endif /*!NC_NCGEN_H*/
|