- for (j = 0; j < names; j++)
- for (i = 0; i < j; i++)
- if (strcmp (name[i], name[j]) == 0)
- warn (_("conflicting outputs to file %s"), quote (name[i]));
+ free (all_but_tab_ext);
+ free (src_extension);
+ free (header_extension);
+}
+
+void
+output_file_name_check (char const *file_name)
+{
+ if (0 == strcmp (file_name, grammar_file))
+ fatal (_("refusing to overwrite the input file %s"), quote (file_name));
+ {
+ int i;
+ for (i = 0; i < file_names_count; i++)
+ if (0 == strcmp (file_names[i], file_name))
+ warn (_("conflicting outputs to file %s"), quote (file_name));
+ }
+ file_names = xnrealloc (file_names, ++file_names_count, sizeof *file_names);
+ file_names[file_names_count-1] = xstrdup (file_name);
+}
+
+void
+output_file_names_free (void)
+{
+ free (all_but_ext);
+ free (spec_verbose_file);
+ free (spec_graph_file);
+ free (spec_xml_file);
+ free (spec_defines_file);
+ free (parser_file_name);
+ free (dir_prefix);
+ {
+ int i;
+ for (i = 0; i < file_names_count; i++)
+ free (file_names[i]);
+ }
+ free (file_names);