| 525 |
|
static int |
| 526 |
|
wrap_up(void) |
| 527 |
|
{ |
| 528 |
< |
char cmd[8192]; |
| 528 |
> |
char cmd[32700]; |
| 529 |
|
|
| 530 |
|
if (bsdf_manuf[0]) { |
| 531 |
|
add_wbsdf("-f", 1); |
| 576 |
|
} |
| 577 |
|
#endif |
| 578 |
|
|
| 579 |
< |
#define HEAD_BUFLEN 8192 |
| 579 |
> |
#define HEAD_BUFLEN 10240 |
| 580 |
|
static char head_buf[HEAD_BUFLEN]; |
| 581 |
|
static int cur_headlen = 0; |
| 582 |
|
|
| 592 |
|
strcpy(head_buf+cur_headlen, s); |
| 593 |
|
cur_headlen += len; |
| 594 |
|
|
| 595 |
+ |
#if defined(_WIN32) || defined(_WIN64) |
| 596 |
+ |
if (head_buf[cur_headlen-1] == '\n') |
| 597 |
+ |
head_buf[cur_headlen-1] = '\t'; |
| 598 |
+ |
#endif |
| 599 |
|
return(1); |
| 600 |
|
} |
| 601 |
|
|
| 618 |
|
main(int argc, char *argv[]) |
| 619 |
|
{ |
| 620 |
|
int dofwd = 0, dobwd = 1; |
| 621 |
< |
char buf[2048]; |
| 621 |
> |
char buf[1024]; |
| 622 |
|
char *cp; |
| 623 |
|
int i, na; |
| 624 |
|
|
| 730 |
|
if (i < argc) { /* open input files if given */ |
| 731 |
|
int nbsdf = 0; |
| 732 |
|
for ( ; i < argc; i++) { /* interpolate each component */ |
| 729 |
– |
char pbuf[256]; |
| 733 |
|
FILE *fpin = fopen(argv[i], "rb"); |
| 734 |
|
if (fpin == NULL) { |
| 735 |
|
fprintf(stderr, "%s: cannot open BSDF interpolant '%s'\n", |
| 736 |
|
progname, argv[i]); |
| 737 |
|
return(1); |
| 738 |
|
} |
| 739 |
< |
sprintf(pbuf, "%s:\n", argv[i]); |
| 740 |
< |
record2header(pbuf); |
| 739 |
> |
sprintf(buf, "%s:\n", argv[i]); |
| 740 |
> |
record2header(buf); |
| 741 |
|
sir_headshare = &record2header; |
| 742 |
|
if (!load_bsdf_rep(fpin)) |
| 743 |
|
return(1); |
| 744 |
|
fclose(fpin); |
| 745 |
|
done_header(); |
| 746 |
< |
sprintf(pbuf, "Interpolating component '%s'", argv[i]); |
| 747 |
< |
prog_start(pbuf); |
| 746 |
> |
sprintf(buf, "Interpolating component '%s'", argv[i]); |
| 747 |
> |
prog_start(buf); |
| 748 |
|
eval_rbf(); |
| 749 |
|
} |
| 750 |
|
return(wrap_up()); |
| 751 |
|
} |
| 752 |
|
SET_FILE_BINARY(stdin); /* load from stdin */ |
| 753 |
+ |
record2header("<stdin>:\n"); |
| 754 |
+ |
sir_headshare = &record2header; |
| 755 |
|
if (!load_bsdf_rep(stdin)) |
| 756 |
|
return(1); |
| 757 |
+ |
done_header(); |
| 758 |
|
prog_start("Interpolating from standard input"); |
| 759 |
|
eval_rbf(); /* resample dist. */ |
| 760 |
|
return(wrap_up()); |