00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048 #define NVLESS 077
00049 #define NV32I 04027
00050 #define NV64I 04077
00051 #define NVREAL 06077
00052 #define NVDOUB 06177
00053
00054
00055
00056 #define WLESS 23
00057 #define W32I 11
00058 #define W64I 23
00059 #define WREAL 23
00060 #define WDOUB 40
00061 #define WCOMP 50
00062
00063 #define MAXDIMS 10
00064 #define MAXNAML 31
00065
00066
00067
00068 #define RNL_ERROR -3
00069
00070 #define RERR(css, n) { \
00071 if (errf) { \
00072 Nreturn(IO_ERR);\
00073 } \
00074 else \
00075 _ferr(css,n); \
00076 }
00077
00078 #define RERR2(css, n,m) { \
00079 if (errf) { \
00080 Nreturn(IO_ERR);\
00081 } \
00082 else \
00083 _ferr(css,n,m); \
00084 }
00085
00086 #define RERR3(css, n,m,t) { \
00087 if (errf) { \
00088 Nreturn(IO_ERR);\
00089 } \
00090 else \
00091 _ferr(css,n,m,t); \
00092 }
00093
00094 #define RNLERROR(s) { \
00095 errno = s; \
00096 return(RNL_ERROR); \
00097 }
00098
00099 #define ISSPTB(c) (((c) == ' ') || ((c) == '\t'))
00100
00101
00102
00103
00104
00105
00106 #undef MIN
00107 #define MIN(a,b) ((a) < (b) ? (a) : (b))
00108
00109
00110
00111
00112
00113
00114
00115
00116 #define MATCH(c,a,b) (a[(c >= 0x3f) ? b+1 : b] & (1 << (IND(c))))
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 #define TOGGLE_CHAR(c,cat,val) { \
00128 if (val) \
00129 _MASKS[(c >= 0x3f) ? cat+1 : cat] |= (1 << (IND(c))); \
00130 else \
00131 _MASKS[(c >= 0x3f) ? cat+1 : cat] &= ~(1 << (IND(c))); \
00132 }
00133
00134
00135
00136 #define IND(c) ((c >= 0x3f) ? 0x7f - (unsigned)c : (unsigned)(0x40 - c - 1))
00137
00138 #define Nreturn(n) { \
00139 ss = n; \
00140 goto ret; \
00141 }
00142
00143
00144
00145 #define NEND(css, n) { \
00146 if (endf) { \
00147 Nreturn(IO_END);\
00148 } \
00149 else \
00150 _ferr(css,n); \
00151 }
00152
00153
00154
00155 #undef TRUE
00156 #define TRUE (_btol(1))
00157
00158 #undef FALSE
00159 #define FALSE (_btol(0))
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171 #define LGET(x) { \
00172 if (!inptr->incnt) \
00173 if (ss = _rnl_fillrec(cup, echoptr, inptr)) \
00174 return(ss); \
00175 x = (char) *inptr->inptr++; \
00176 inptr->incnt--; \
00177 }
00178
00179 #define CMNTLGET(x) { \
00180 if (!inptr->incnt) \
00181 if (ss = _rnl_fillrec(cup, echoptr, inptr)) \
00182 return(ss); \
00183 x = (char) *inptr->inptr++; \
00184 if (MATCH(x, _MASKS, MRNLCOMM)) { \
00185 x = ' '; \
00186 \
00187 inptr->incnt = 1; \
00188 } \
00189 inptr->incnt--; \
00190 }
00191
00192
00193
00194
00195
00196
00197
00198 #define MAINLGET(x) { \
00199 if (!inptr->incnt) \
00200 if (ss = _rnl_fillrec(cup, echoptr, inptr)) { \
00201 if (ss == EOF) { \
00202 NEND(css, FERDNLEF); \
00203 } \
00204 else { \
00205 RERR(css, ss); \
00206 } \
00207 } \
00208 x = (char) *inptr->inptr++; \
00209 inptr->incnt--; \
00210 }
00211
00212 #define MAINCMNTLGET(x) { \
00213 if (!inptr->incnt) \
00214 if (ss = _rnl_fillrec(cup, echoptr, inptr)) { \
00215 if (ss == EOF) { \
00216 NEND(css, FERDNLEF); \
00217 } \
00218 else { \
00219 RERR(css, ss); \
00220 } \
00221 } \
00222 x = (char) *inptr->inptr++; \
00223 if (MATCH(x, _MASKS, MRNLCOMM)) { \
00224 x = ' '; \
00225 inptr->incnt = 1; \
00226 } \
00227 inptr->incnt--; \
00228 }
00229
00230
00231
00232 #define MRNLDELIM 0
00233 #define MRNLREP 4
00234 #define MRNLSEP 6
00235 #define MRNLFLAG 8
00236 #define MRNLCOMM 10
00237
00238 struct Inpinfo {
00239 long *inbuff;
00240
00241
00242
00243 long *instart;
00244 long *inptr;
00245 long incnt;
00246 };
00247
00248 typedef struct {
00249 signed int lower : 32,
00250 span : 32;
00251 } Dims;
00252
00253 typedef struct {
00254
00255 char varname[MAXNAML+1];
00256
00257 struct {
00258 unsigned nels : 32,
00259 unused : 1,
00260 type : 4,
00261
00262
00263
00264
00265
00266 munused : 2,
00267 taskcm : 1,
00268 ndims : 3,
00269 newfmt : 3,
00270
00271 lmf : 1,
00272 stkf : 1,
00273 offdim : 16;
00274
00275 } na;
00276
00277 struct {
00278 #ifdef _ADDR64
00279 unsigned long varaddr ;
00280
00281
00282
00283
00284 #else
00285 unsigned reserved : 16,
00286 lmaddr : 16,
00287
00288
00289
00290 varaddr : 32;
00291
00292
00293
00294
00295 #endif
00296 } va;
00297
00298 } Nlentry;
00299
00300 typedef struct {
00301 char nlname[MAXNAML+1];
00302 Nlentry nlvnames[1];
00303 } Namelist;
00304
00305
00306
00307 extern long _wnlrecsiz;
00308 extern long _BLNKSEP;
00309 extern long _MASKS[];
00310 extern long OUT_CHAR;
00311 extern long OUT_ECHO;
00312 extern long OUT_EQ;
00313 extern long OUT_LINE;
00314 extern long OUT_SEP;
00315 extern unum_t _OUT_UNIT;
00316 extern long _SKP_MESS;
00317 extern long _TYP_CONV;