lilypond-1.3.9
[lilypond.git] / flower / text-stream.cc
blob737b41196075b6487944aa75f4097e46b486a4b3
1 #include "text-stream.hh"
3 Text_stream::Text_stream (String fn)
5 ios::sync_with_stdio();
6 if (fn == "")
8 name = _ ("<stdin>");
9 f = stdin;
12 else
14 name = fn;
15 f = fopen (fn.ch_C (), "r");
18 if (!f)
20 cerr << __FUNCTION__
21 << ": " << _f ("Can't open file: `%s'", fn) << '\n';
22 exit (1);
25 line_no = 1;
28 void
29 Text_stream::message (String s)
31 cerr << '\n'<<get_name() << ": " << line ()<<": "<<s<<endl;
34 bool
35 Text_stream::eof_b ()
37 /* UGH UGH ugh*/
38 return
39 // !pushback.size () &&
40 feof (f);