2 scores.cc -- implement some globals
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 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"
20 #include "lily-version.hh"
22 Sources
* source_global_l
= 0;
23 Array
<String
> inclusion_global_array
;
24 Array
<String
> target_str_global_array
;
25 Link_array
<Score
> score_global_array
;
26 Scope
* header_global_p
;
29 void write_dependency_file (String fn
, Array
<String
> targets
,
32 const int WRAPWIDTH
= 65;
35 cout
<< _f ("Writing dependency file: `%s'...", fn
) << '\n';
36 ofstream
f (fn
.ch_C ());
38 warning (_f ("Can't open file: `%s'", fn
));
40 f
<< "# Automatically generated by " << gnu_lilypond_version_str () << '\n';
42 for (int i
=0; i
< targets
.size (); i
++)
43 out
+= targets
[i
] + " ";
45 for (int i
=0; i
< deps
.size (); i
++)
47 if (out
.length_i() > WRAPWIDTH
)
60 if (dependency_global_b
)
62 write_dependency_file (default_outname_base_global
+ ".dep", target_str_global_array
,
63 inclusion_global_array
);
72 header_global_p
= new Scope
;
73 for (int i
=0; i
< score_global_array
.size(); i
++)
75 Score
* is_p
= score_global_array
[i
];
77 if (is_p
->errorlevel_i_
)
79 is_p
->warning (_("Score contains errors; will not process it"));
84 if (flower_dstream
&& !flower_dstream
->silent_b ("do_scores"))
95 junk_pointer_array (score_global_array
);
97 inclusion_global_array
.clear ();
98 delete header_global_p
;
104 do_one_file (String init_str
, String file_str
)
106 if (init_str
.length_i () && global_path
.find (init_str
).empty_b ())
108 warning (_f ("Can't find file: `%s'", init_str
));
109 warning (_f ("(search path: `%s')", global_path
.str ().ch_C()));
112 if ((file_str
!= "-") && global_path
.find (file_str
).empty_b ())
114 warning (_f ("Can't find file: `%s'", file_str
));
119 source_global_l
= &sources
;
120 source_global_l
->set_path (&global_path
);
122 My_lily_parser
parser (source_global_l
);
123 parser
.set_version_check (version_ignore_global_b
);
124 parser
.parse_file (init_str
, file_str
);
126 if (parser
.error_level_i_
)