From 35a42a6c22905c1aafb85ff394688af0d48dceb0 Mon Sep 17 00:00:00 2001
From: fred <fred>
Date: Sun, 24 Mar 2002 20:12:13 +0000
Subject: [PATCH] lilypond-1.0.1

---
 Documentation/BLURB.in        |  6 ++++
 flower/file-path.cc           | 13 +++++----
 flower/include/text-db.hh     |  4 +--
 flower/include/text-stream.hh | 12 ++++----
 flower/text-db.cc             | 52 +++++++++++++++++------------------
 flower/text-stream.cc         | 44 +++++++++++++++++------------
 input/example-2.fly           | 13 +++++++++
 input/example-3.ly            | 29 +++++++++++++++++++
 8 files changed, 117 insertions(+), 56 deletions(-)
 create mode 100644 Documentation/BLURB.in
 create mode 100644 input/example-2.fly
 create mode 100644 input/example-3.ly

diff --git a/Documentation/BLURB.in b/Documentation/BLURB.in
new file mode 100644
index 0000000000..68ca4dc05e
--- /dev/null
+++ b/Documentation/BLURB.in
@@ -0,0 +1,6 @@
+LilyPond is the GNU Project music typesetter.  This program can print
+beautiful sheet music from a music definition file.  It can also play
+mechanical performances to a MIDI file.  Features include multiple
+staffs, meters, clefs, keys, lyrics, versatile input language, cadenzas,
+beams, slurs, triplets, formatting scores, part extraction.  It includes
+a nice font of musical symbols.
diff --git a/flower/file-path.cc b/flower/file-path.cc
index e6f9c4cff7..3b76d4b1dd 100644
--- a/flower/file-path.cc
+++ b/flower/file-path.cc
@@ -74,20 +74,23 @@ File_path::parse_path (String p)
 /** find a file.
   It will search in the current dir, in the construction-arg, and
   in any other added path, in this order.
+
+  @return
+  The full path if found, or empty string if not found
   */
 String
 File_path::find (String nm) const
 {
-  fdebug << _("looking for ") << nm << ": ";
+  fdebug << "looking for" << nm << ": ";
   if (!nm.length_i() || (nm == "-") )
     return nm;
   for (int i=0; i < size(); i++)
     {
       String path  = elem(i);
-      String sep (DIRSEP);
+      String sep = to_str (DIRSEP);
       String right(path.right_str (1));
       if (path.length_i () && right != sep)
-	path += DIRSEP;
+	path += to_str (DIRSEP);
 
       path += nm;
 
@@ -95,12 +98,12 @@ File_path::find (String nm) const
       FILE *f = fopen (path.ch_C(), "r"); // ugh!
       if (f)
 	{
-	  fdebug << _("found\n");
+	  fdebug << "found\n";
 	  fclose (f);
 	  return path;
 	}
     }
-  fdebug << "\n";
+  fdebug << '\n';
   return "";
 }
 
diff --git a/flower/include/text-db.hh b/flower/include/text-db.hh
index ab3e9c82b5..6e90e38c47 100644
--- a/flower/include/text-db.hh
+++ b/flower/include/text-db.hh
@@ -40,7 +40,7 @@ public:
 
     Text_db (String fn):Data_file (fn) { }
     Data_file::error;
-    bool eof();
+    bool eof_b ();
 
     /// get next line.
     Text_record operator++(int) {
@@ -48,7 +48,7 @@ public:
     }
     /// are we done yet?
     operator bool() {
-	return !eof();
+	return !eof_b ();
     }
 };
 
diff --git a/flower/include/text-stream.hh b/flower/include/text-stream.hh
index 4d369fdbbb..3bebb08505 100644
--- a/flower/include/text-stream.hh
+++ b/flower/include/text-stream.hh
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include "string.hh"
-#include "varray.hh"
+#include "array.hh"
 
 /**
   line counting input stream. 
@@ -28,10 +28,8 @@ class Text_stream
 public:
   Text_stream (String fn);
   String get_name() { return name; }
-  bool eof() {
-    return feof (f);
-  }
-  char    get() {
+  bool eof_b();
+  char get() {
     char c;
 	
     if (pushback.empty())
@@ -49,6 +47,8 @@ public:
     pushback.push (c);
   }
   char peek() {
+    if (eof_b ())
+      return -1;
     char c = get();
     unget (c);
     return c;
@@ -61,7 +61,7 @@ public:
   }
 
   ~Text_stream(){
-    if (!eof()) 
+    if (!eof_b()) 
       cerr <<__FUNCTION__<< ": closing unended file";
     
     fclose (f);
diff --git a/flower/text-db.cc b/flower/text-db.cc
index fef860eb31..e59748f665 100644
--- a/flower/text-db.cc
+++ b/flower/text-db.cc
@@ -1,9 +1,9 @@
 #include "text-db.hh"
 bool
-Text_db::eof()
+Text_db::eof_b ()
 {
   Data_file::gobble_leading_white();
-  return  Data_file::eof();
+  return  Data_file::eof_b();
 }
 
 void
@@ -11,41 +11,41 @@ Text_db::gobble_leading_white()
 {
   while (1) 
     {
-	Data_file::gobble_leading_white();
-	if (eof())
-	    return ;
-	char c;
-	if  ((c = data_get()) !='\n')
-	  {
-	    data_unget (c);
-	    return ;
+      Data_file::gobble_leading_white();
+      if (eof_b ())
+	return ;
+      char c;
+      if  ((c = data_get()) !='\n')
+	{
+	  data_unget (c);
+	  return ;
 	}	
-  }	
+    }	
 }
 
 
 Text_record
 Text_db::get_record() 
 {
-   while (1) 
-   {
-	String s;
-	Array<String> fields;
-	assert (!eof());
+  while (1) 
+    {
+      String s;
+      Array<String> fields;
+      assert (!eof_b ());
 	
-	while ((s = get_word()) != "")
-	    {
-	    fields.push (s);	
-	    gobble_white();
-	      }
+      while ((s = get_word()) != "")
+	{
+	  fields.push (s);	
+	  gobble_white();
+	}
 	     
 
-	if (get_line() != "")
-	    assert (false);
+      if (get_line() != "")
+	assert (false);
     
-	assert (fields.size());
-	return Text_record (fields, get_name(), line ());
-   }
+      assert (fields.size());
+      return Text_record (fields, get_name(), line ());
+    }
 }
 
 
diff --git a/flower/text-stream.cc b/flower/text-stream.cc
index 01d2e8ef5c..9c87211c25 100644
--- a/flower/text-stream.cc
+++ b/flower/text-stream.cc
@@ -4,28 +4,38 @@ Text_stream::Text_stream (String fn)
 {
   ios::sync_with_stdio();
   if (fn == "")
-	    {
-	    name = _("<STDIN>");
-	    f = stdin;
-	      }
-
-	else
-	    {
-	    name = fn;
-	    f = fopen (fn.ch_C (), "r");
-	      }
+    {
+      name = _ ("<stdin>");
+      f = stdin;
+    }
 
-	if (!f)
-	  {
-	    cerr <<__FUNCTION__<< _(": can't open `") << fn << "'\n";
-	    exit (1);
-	  }
+  else
+    {
+      name = fn;
+      f = fopen (fn.ch_C (), "r");
+    }
 
-	line_no = 1;
+  if (!f)
+    {
+      cerr << __FUNCTION__ 
+	   << ": " << _f ("can't open file: `%s'", fn) << '\n';
+      exit (1);
     }
 
+  line_no = 1;
+}
+
 void
 Text_stream::message (String s)
 {
-  cerr << "\n"<<get_name() << ": " << line ()<<": "<<s<<endl;
+  cerr << '\n'<<get_name() << ": " << line ()<<": "<<s<<endl;
+}
+
+bool
+Text_stream::eof_b ()
+{
+  /* UGH UGH ugh*/
+    return
+      // !pushback.size () && 
+      feof (f);
 }
diff --git a/input/example-2.fly b/input/example-2.fly
new file mode 100644
index 0000000000..813fed7131
--- /dev/null
+++ b/input/example-2.fly
@@ -0,0 +1,13 @@
+a''2 ~ c4( [e8 )e] [a,16 a a a]
+
+% Some beamed and slurred notes of different taste in Mudela.
+%
+% Type:
+%
+%     ly2dvi example-2
+%     xdvi example-2     # or your dvi viewer here
+%
+% For more elaborate examples see twinkle.ly, kortjakje.ly and mutopia/*.
+%
+% A docmument on Mudela is under construction: Documentation/tex/mudela.doc
+% (available as .ps from the website too).
diff --git a/input/example-3.ly b/input/example-3.ly
new file mode 100644
index 0000000000..ebd4ba1851
--- /dev/null
+++ b/input/example-3.ly
@@ -0,0 +1,29 @@
+one = \melodic\relative c{
+	c'' d e f
+}
+
+two = \melodic\relative c{
+	\clef "bass";
+	c'2 g2
+}
+
+\score{
+	<
+		\one
+		\two
+	>
+	\paper{}
+	\midi{}
+}
+
+% A full-mudala example with two staffs
+%
+% Type:
+%
+%     ly2dvi example-3
+%     xdvi example-3     # or your dvi viewer here
+%
+% For more elaborate examples see twinkle.ly, kortjakje.ly and mutopia/*.
+%
+% A docmument on Mudela is under construction: Documentation/tex/mudela.doc
+% (available as .ps from the website too).
-- 
2.39.5