1 /*- 2 * Copyright (c) 1980 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.proprietary.c% 6 * 7 * @(#)nmlio.h 5.2 (Berkeley) 04/12/91 8 */ 9 10 /* header for namelist I/O */ 11 12 #define ERRNM(x) if(n=(x)) return(n); 13 #define VL 16 /* variable name length from f77pass1/defs.h */ 14 15 extern char namelistkey_; 16 17 typedef struct 18 { 19 char namelistname[VL+4]; /* 4 for padding */ 20 struct namelistentry 21 { 22 char varname[VL+4]; /* 4 for padding */ 23 char *varaddr; 24 short int type; 25 short int typelen; 26 /* 27 * If dimp is not null, then the corner element of the array is 28 * at varaddr. However, the element with subscripts: 29 * (i1,...,in) is at 30 * 31 * varaddr - dimp->baseoffset + sizeoftype * 32 * ((i1-1)+span[0]*((i2-1)+span[1]*...) 33 */ 34 int *dimp; /* dimension info: (null means scalar) 35 *dimp: numb. of dim., 36 dimp[0]: number of dimensions 37 dimp[1]: total number of elements, 38 dimp[2]: base offset, 39 dimp[3]: span of 1st dimension 40 dimp[4]: span of 2nd dimension 41 ... */ 42 } names[1]; /* actually one per name in the namelist */ 43 } Namelist; 44 45 typedef struct 46 { flag cierr; 47 ftnint ciunit; 48 flag ciend; 49 Namelist *namelist; 50 } namelist_arglist; 51