7 |
|
* G. Ward February 2015 |
8 |
|
*/ |
9 |
|
|
10 |
+ |
#include "platform.h" |
11 |
|
#include <ctype.h> |
12 |
|
#include "rtio.h" |
13 |
|
#include "paths.h" |
83 |
|
|
84 |
|
int ndataf = 0; /* number of data files */ |
85 |
|
|
86 |
+ |
int unlink_datafiles = 0; /* unlink data files when done */ |
87 |
+ |
|
88 |
|
const char *spectr_file[MAXFILES]; /* custom spectral curve input */ |
89 |
|
|
90 |
|
const char top_level_name[] = "WindowElement"; |
166 |
|
fprintf(stderr, "%s: cannot open\n", inpspec); |
167 |
|
return ""; |
168 |
|
} |
169 |
< |
#ifndef _WIN32 /* XXX somehow broken on Windows */ |
169 |
> |
#if !defined(_WIN32) && !defined(_WIN64) |
170 |
> |
/* XXX somehow broken on Windows */ |
171 |
|
len = lseek(fd, 0L, SEEK_END); |
172 |
|
if (len > 0) { |
173 |
|
lseek(fd, 0L, SEEK_SET); |
608 |
|
fputs(xml+ei, stdout); /* write trailer */ |
609 |
|
free(xml); /* free string */ |
610 |
|
fputc('\n', stdout); |
611 |
< |
return (fflush(stdout) == 0); |
611 |
> |
if (fflush(stdout) != 0) |
612 |
> |
return 0; |
613 |
> |
/* unlink data files if req. */ |
614 |
> |
for (i = ndataf*(unlink_datafiles != 0); i--; ) |
615 |
> |
if (data_file[i].fname != stdin_name && |
616 |
> |
data_file[i].fname[0] != '!') |
617 |
> |
unlink(data_file[i].fname); |
618 |
> |
if (unlink_datafiles > 1 && mgf_geometry != NULL && |
619 |
> |
mgf_geometry != stdin_name && |
620 |
> |
mgf_geometry[0] != '!') |
621 |
> |
unlink(mgf_geometry); |
622 |
> |
return 1; |
623 |
|
} |
624 |
|
|
625 |
|
/* Insert BSDF data into XML wrapper */ |
782 |
|
return 1; |
783 |
|
} |
784 |
|
attr_unit = argv[i]; |
785 |
+ |
continue; |
786 |
+ |
case 'U': /* unlink data files when done */ |
787 |
+ |
unlink_datafiles = 1 + (argv[i][2] == 'U'); |
788 |
|
continue; |
789 |
|
case 'a': /* angle basis */ |
790 |
|
if (++i >= argc) |