1 /*********************************************************************
2  *   Copyright 1993, UCAR/Unidata
3  *   See netcdf/COPYRIGHT file for copying and redistribution conditions.
4  *   $Header: /private-cvsroot/minc/progs/mincdump/mincdump.h,v 1.1 2004-04-27 15:35:15 bert Exp $
5  *********************************************************************/
6 
7 
8 /* error checking macro */
9 #define NC_CHECK(status)    {\
10 	    int nc_status = status;\
11 	    if(nc_status < 0)\
12 	        error(nc_strerror(nc_status));\
13 	}
14 
15 #define  Printf  (void) printf
16 
17 typedef int boolean;
18 enum {my_false=0, my_true=1};
19 
20 struct ncdim {			/* dimension */
21     char name[NC_MAX_NAME];
22     long size;
23 };
24 
25 struct ncvar {			/* variable */
26     char name[NC_MAX_NAME];
27     nc_type type;
28     int ndims;
29     int dims[MAX_VAR_DIMS];
30     int natts;
31     boolean has_fillval;
32     double fillval;
33 };
34 
35 struct ncatt {			/* attribute */
36     int var;
37     char name[NC_MAX_NAME];
38     nc_type type;
39     int len;
40     char *string;		/* for text attributes (type = NC_CHAR) */
41     double *vals;		/* for numeric attributes of all types */
42 };
43 
44 typedef
45 enum {LANG_C, LANG_F} Nclang;
46 
47 struct fspec {			/* specification for how to format dump */
48 
49     char *name;			/* name specified with -n or derived from
50 				 * file name */
51 
52     boolean header_only;	/* if true, don't print any variable data */
53 
54     boolean coord_vals;		/* if true, print header and coordinate
55 				 * dimension values (values of variables
56 				 * that are also dimensions), but no other
57 				 * variable data */
58 
59     boolean brief_data_cmnts;	/* if true, put // comments in data section
60 				 * identifying variable and indices, useful
61 				 * for navigating through large
62 				 * multi-dimensional data lists.  */
63 
64     boolean full_data_cmnts;	/* if true, put // comments in data section
65 				 * identifying every value, useful for
66 				 * navigating through large
67 				 * multi-dimensional data lists.  */
68 
69     Nclang data_lang;		/* Specifies index conventions used in data
70 				 * comments, either LANG_C (C, 0-based,
71 				 * column major) or LANG_F (Fortran,
72 				 * 1-based, row major) */
73 
74     int nlvars;			/* Number of variables specified with -v
75 				 * option on command line */
76 
77     char** lvars;		/* list of variable names specified with -v
78 				 * option on command line */
79 };
80