]> git.donarmstrong.com Git - lilypond.git/blob - flower/text-stream.cc
release: 0.1.16
[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.ch_C (), "r");
16               }
17         
18         if (!f) 
19           {
20             cerr <<__FUNCTION__<< ": can't open `" << fn << "'\n";
21             exit (1);
22           }
23
24         line_no = 1;
25     }
26
27 void
28 Text_stream::message (String s)
29 {
30   cerr << "\n"<<get_name() << ": " << line ()<<": "<<s<<endl;
31 }
32