lilypond-1.1.55
[lilypond.git] / flower / text-stream.cc
blob9c87211c252e02ff06cf9f9c60733936cff49731
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);