| 12 |
|
#include <ctype.h> |
| 13 |
|
#include <math.h> |
| 14 |
|
#include "platform.h" |
| 15 |
+ |
#include "rtio.h" |
| 16 |
|
|
| 17 |
|
#define MAXCOL 8192 /* maximum number of columns */ |
| 18 |
|
|
| 171 |
|
int nf; |
| 172 |
|
/* reading binary input? */ |
| 173 |
|
if (nbicols > 0) |
| 174 |
< |
return(fread(field, sizeof(double), nbicols, fp)); |
| 174 |
> |
return(getbinary(field, sizeof(double), nbicols, fp)); |
| 175 |
|
if (nbicols < 0) { |
| 176 |
|
float *fbuf = (float *)buf; |
| 177 |
|
int i; |
| 178 |
< |
nf = fread(fbuf, sizeof(float), -nbicols, fp); |
| 178 |
> |
nf = getbinary(fbuf, sizeof(float), -nbicols, fp); |
| 179 |
|
for (i = nf; i-- > 0; ) |
| 180 |
|
field[i] = fbuf[i]; |
| 181 |
|
return(nf); |
| 212 |
|
{ |
| 213 |
|
/* binary output? */ |
| 214 |
|
if (bocols > 0) { |
| 215 |
< |
fwrite(field, sizeof(double), n, fp); |
| 215 |
> |
putbinary(field, sizeof(double), n, fp); |
| 216 |
|
return; |
| 217 |
|
} |
| 218 |
|
if (bocols < 0) { |
| 219 |
|
float fv; |
| 220 |
|
while (n-- > 0) { |
| 221 |
|
fv = *field++; |
| 222 |
< |
fwrite(&fv, sizeof(float), 1, fp); |
| 222 |
> |
putbinary(&fv, sizeof(float), 1, fp); |
| 223 |
|
} |
| 224 |
|
return; |
| 225 |
|
} |
| 328 |
|
break; |
| 329 |
|
if (!subtotal) |
| 330 |
|
ltotal = 0; |
| 331 |
+ |
if (incnt > 0 && nlin >= incnt) |
| 332 |
+ |
break; |
| 333 |
|
} |
| 334 |
|
/* close input */ |
| 335 |
|
return(fclose(fp)); |