]> git.donarmstrong.com Git - lilypond.git/blob - flower/text-stream.cc
release: 0.0.38
[lilypond.git] / flower / text-stream.cc
1 #include "text-stream.hh"
2
3 Text_stream::Text_stream(String fn)
4 {
5     ios::sync_with_stdio();
6     if (fn == "") 
7             {
8             name = "<STDIN>";       
9             f = stdin;
10             }
11         
12         else 
13             {
14             name = fn;      
15             f = fopen(fn, "r");
16             }
17         
18         if (!f) {
19             cerr <<__FUNCTION__<< ": can't open `" << fn << "'\n";
20             exit(1);
21         }
22
23         line_no = 1;
24     }
25
26 void
27 Text_stream::message(String s)
28 {
29     cerr << "\n"<<get_name() << ": " << line()<<": "<<s<<endl;
30 }
31