2 scores.cc -- implement some globals
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "paper-def.hh"
16 #include "file-path.hh"
17 #include "file-results.hh"
18 #include "my-lily-parser.hh"
21 Sources* source_global_l = 0;
22 Array<String> inclusion_global_array;
23 Array<String> target_str_global_array;
24 Link_array<Score> score_global_array;
25 Header * header_global_p;
28 void write_dependency_file (String fn, Array<String> targets,
31 const int WRAPWIDTH = 65;
34 cout << _f ("writing dependency file: `%s\'...", fn) << '\n';
35 ofstream f (fn.ch_C ());
37 warning (_f ("can't open file: `%s\'", fn));
39 f << "# Automatically generated by " << get_version_str () << '\n';
41 for (int i=0; i < targets.size (); i ++)
42 out += targets[i] + " ";
44 for (int i=0; i < deps.size (); i ++)
46 if (out.length_i() > WRAPWIDTH)
59 if (dependency_global_b)
61 write_dependency_file (default_outname_base_global + ".dep", target_str_global_array,
62 inclusion_global_array);
71 header_global_p = new Header;
72 for (int i=0; i < score_global_array.size(); i++)
74 Score* is_p = score_global_array[i];
76 if (is_p->errorlevel_i_)
78 is_p->warning (_("score contains errors; will not process it"));
83 if (!monitor->silent_b ("do_scores"))
94 for (int i=0; i < score_global_array.size(); i++)
96 delete score_global_array[i];
98 score_global_array.clear();
99 inclusion_global_array.clear ();
100 delete header_global_p ;
106 do_one_file (String init_str, String file_str)
108 if (init_str.length_i () && global_path.find (init_str).empty_b ())
110 warning (_f ("can't find file: `%s\'", init_str));
113 if ((file_str != "-") && global_path.find (file_str).empty_b ())
115 warning (_f ("can't find file: `%s\'", file_str));
120 source_global_l = &sources;
121 source_global_l->set_path (&global_path);
123 My_lily_parser parser (source_global_l);
124 parser.set_version_check (version_ignore_global_b);
125 parser.parse_file (init_str, file_str);
127 if (parser.error_level_i_)