122 |
|
"\t</DataDefinition>\n", |
123 |
|
}; |
124 |
|
|
125 |
+ |
/* Check that the last-added data file is unique */ |
126 |
+ |
static int |
127 |
+ |
check_new_data_file() |
128 |
+ |
{ |
129 |
+ |
int i = ndataf; |
130 |
+ |
|
131 |
+ |
while (i-- > 0) |
132 |
+ |
if ((data_file[i].spectrum == data_file[ndataf].spectrum) & |
133 |
+ |
(data_file[i].type == data_file[ndataf].type)) { |
134 |
+ |
fprintf(stderr, |
135 |
+ |
"%s: warning - ignoring duplicate component\n", |
136 |
+ |
data_file[ndataf].fname); |
137 |
+ |
return 0; |
138 |
+ |
} |
139 |
+ |
return 1; |
140 |
+ |
} |
141 |
+ |
|
142 |
|
/* Copy data from file descriptor to stdout and close */ |
143 |
|
static int |
144 |
|
copy_and_close(int fd) |
852 |
|
} |
853 |
|
data_file[ndataf].fname = argv[i]; |
854 |
|
data_file[ndataf].spectrum = cur_spectrum; |
855 |
< |
ndataf++; |
855 |
> |
ndataf += check_new_data_file(); |
856 |
|
continue; |
857 |
|
case 'r': /* reflection */ |
858 |
|
if (i >= argc-1) |