281 |
|
if (inpfmt != NULL) |
282 |
|
return(getrec()); |
283 |
|
if (tolower(itype) == 'd') { |
284 |
< |
if (fread(inpbuf, sizeof(double), nbicols, fp) != nbicols) |
284 |
> |
if (getbinary(inpbuf, sizeof(double), nbicols, fp) != nbicols) |
285 |
|
return(0); |
286 |
|
if (itype == 'D') |
287 |
|
swap64(inpbuf, nbicols); |
288 |
|
return(1); |
289 |
|
} |
290 |
|
if (tolower(itype) == 'f') { |
291 |
< |
if (fread(inpbuf, sizeof(float), nbicols, fp) != nbicols) |
291 |
> |
if (getbinary(inpbuf, sizeof(float), nbicols, fp) != nbicols) |
292 |
|
return(0); |
293 |
|
if (itype == 'F') |
294 |
|
swap32(inpbuf, nbicols); |
466 |
|
float fval = v; |
467 |
|
|
468 |
|
while (++colpos < n) |
469 |
< |
fwrite(zerobuf, |
469 |
> |
putbinary(zerobuf, |
470 |
|
tolower(otype)=='d' ? sizeof(double) : sizeof(float), |
471 |
|
1, stdout); |
472 |
|
switch (otype) { |
474 |
|
swap64((char *)&v, 1); |
475 |
|
/* fall through */ |
476 |
|
case 'd': |
477 |
< |
fwrite(&v, sizeof(double), 1, stdout); |
477 |
> |
putbinary(&v, sizeof(double), 1, stdout); |
478 |
|
break; |
479 |
|
case 'F': |
480 |
|
swap32((char *)&fval, 1); |
481 |
|
/* fall through */ |
482 |
|
case 'f': |
483 |
< |
fwrite(&fval, sizeof(float), 1, stdout); |
483 |
> |
putbinary(&fval, sizeof(float), 1, stdout); |
484 |
|
break; |
485 |
|
} |
486 |
|
} |