]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/paper-score.cc (process): Do not show progress newline.
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 14 Jun 2004 13:39:41 +0000 (13:39 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 14 Jun 2004 13:39:41 +0000 (13:39 +0000)
* lily/paper-book.cc (output, classic_output): Show progess
newline after score.

22 files changed:
ChangeLog
lily/book-paper-def.cc
lily/book.cc
lily/context-def.cc
lily/duration.cc
lily/grob-scheme.cc
lily/identifier-smob.cc
lily/include/ly-module.hh
lily/lily-guile.cc
lily/ly-module.cc
lily/moment.cc
lily/my-lily-parser.cc
lily/output-def.cc
lily/paper-book.cc
lily/paper-outputter.cc
lily/paper-score.cc
lily/pitch.cc
lily/score.cc
lily/script-column.cc
lily/stencil-scheme.cc
lily/system.cc
scm/define-markup-commands.scm

index fdc7a9797db8b9db3ce509bc332b60bbcb5ba7a8..4c94a60dca8d9a21bd6ba3c23949ea8961b0ffef 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,21 @@
+2004-06-14  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * lily/paper-score.cc (process): Do not show progress newline.
+
+       * lily/paper-book.cc (output, classic_output): Show progess
+       newline after score.
+
 2004-06-14  Heikki Junes <hjunes@cc.hut.fi>
 
        * buildscripts/lilypond-words.py: add ly/vlaams.ly
 
 2004-06-14  Jan Nieuwenhuizen  <janneke@gnu.org>
 
+       * lily/score.cc (ly:run-translator): Do not crash on empty music
+       list.
+
+       * lily/book.cc (process): Do not render score when systems is empty.
+
        * input/simple-song.ly: Down one octave.
 
        * scm/output-gnome.scm: Remove script again; re-add modules fix
index 517887939eb85d37a24b1fd803eef157b8d0e63b..95d7114dc25757884f1b7fd52b5523e3268289ee 100644 (file)
@@ -1,38 +1,31 @@
 /* 
   book-paper-def.cc -- implement Output_def
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-  
 */
 
-#include "ly-module.hh"
-#include "output-def.hh"
 #include "dimensions.hh"
-#include "ly-smobs.icc"
 #include "font-metric.hh"
-#include "virtual-font-metric.hh"
+#include "ly-module.hh"
+#include "output-def.hh"
 #include "scaled-font-metric.hh"
+#include "virtual-font-metric.hh"
 
 Real
-output_scale (Output_def  * od)
+output_scale (Output_def *od)
 {
   return ly_scm2double (od->lookup_variable (ly_symbol2scm ("outputscale")));
 }
 
-/*
-  TODO: should add nesting for Output_def here too. 
- */
-Font_metric*
-find_scaled_font (Output_def * mod,
+/* TODO: should add nesting for Output_def here too. */
+Font_metric *
+find_scaled_font (Output_def *mod,
                  Font_metric *f, Real m, SCM input_enc_name)
 {
   if (mod->parent_)
-    {
-      return find_scaled_font (mod->parent_,
-                              f, m, input_enc_name);
-    }
+    return find_scaled_font (mod->parent_, f, m, input_enc_name);
   
   Real lookup_mag = m;
   if (!dynamic_cast<Virtual_font_metric*> (f))
@@ -61,18 +54,14 @@ find_scaled_font (Output_def * mod,
   SCM val = SCM_EOL;
   if (Virtual_font_metric * vf = dynamic_cast<Virtual_font_metric*> (f))
     {
-      /*
-       For fontify_atom (), the magnification and name must be known
-       at the same time. That's impossible for
-
-         Scaled (Virtual_font (Font1,Font2))
-
-       so we replace by
-
-         Virtual_font (Scaled (Font1), Scaled (Font2))
-
-      */
-      
+      /* For fontify_atom (), the magnification and name must be known
+        at the same time. That's impossible for
+        
+        Scaled (Virtual_font (Font1,Font2))
+        
+        so we replace by
+        
+        Virtual_font (Scaled (Font1), Scaled (Font2))  */
       SCM lst = SCM_EOL;
       SCM *t = &lst;
       for (SCM s = vf->get_font_list (); ly_c_pair_p (s); s = ly_cdr (s))
@@ -91,7 +80,8 @@ find_scaled_font (Output_def * mod,
     {
       if (!ly_c_symbol_p (input_enc_name))
        {
-         SCM var = ly_module_lookup (mod->scope_, ly_symbol2scm ("inputencoding"));
+         SCM var = ly_module_lookup (mod->scope_,
+                                     ly_symbol2scm ("inputencoding"));
          if (var != SCM_BOOL_F) 
            input_enc_name = scm_variable_ref (var);
          if (!ly_c_symbol_p (input_enc_name))
@@ -108,17 +98,14 @@ find_scaled_font (Output_def * mod,
   return unsmob_metrics (val);
 }
 
-/*
-  TODO: this is a nasty interface. During formatting,
-  the Output_def should be scaled to the output_scale_
-  specified in the toplevel Output_def.
- */
-Output_def* 
-scale_output_def (Output_def * o, Real amount)
+/* TODO: this is a nasty interface. During formatting,
+   the Output_def should be scaled to the output_scale_
+   specified in the toplevel Output_def.  */
+Output_def * 
+scale_output_def (Output_def *o, Real amount)
 {
   SCM proc = ly_scheme_function ("scale-paper");
-  SCM new_pap = scm_call_2 (proc, o->self_scm (),
-                           scm_double2num (amount));
+  SCM new_pap = scm_call_2 (proc, o->self_scm (), scm_double2num (amount));
   scm_gc_protect_object (new_pap);
 
   return unsmob_output_def (new_pap);
@@ -144,7 +131,7 @@ LY_DEFINE (ly_bookpaper_fonts, "ly:bookpaper-fonts",
           s = ly_cdr (s))
        {
          SCM entry = ly_car (s);
-         for (SCM t = ly_cdr (entry); ly_c_pair_p (t); t  = ly_cdr (t))
+         for (SCM t = ly_cdr (entry); ly_c_pair_p (t); t = ly_cdr (t))
            {
              Font_metric *fm = unsmob_metrics (ly_cdar (t));
 
index 4a26b47a73d3233fa5b1aa538f351e477b4d4285..5159c117b4a8a11ce38cc90920d73353885b1275 100644 (file)
@@ -8,20 +8,17 @@
 
 #include <stdio.h>
 
-
-#include "ly-smobs.icc"
-#include "stencil.hh"
 #include "book.hh"
 #include "global-context.hh"
 #include "ly-module.hh"
 #include "main.hh"
 #include "music-iterator.hh"
-#include "output-def.hh"
 #include "music-output.hh"
 #include "music.hh"
-#include "paper-book.hh"
 #include "output-def.hh"
+#include "paper-book.hh"
 #include "score.hh"
+#include "stencil.hh"
 #include "warn.hh"
 
 Book::Book ()
@@ -37,6 +34,7 @@ Book::~Book ()
 {
 }
 
+#include "ly-smobs.icc"
 IMPLEMENT_SMOBS (Book);
 IMPLEMENT_DEFAULT_EQUAL_P (Book);
 
@@ -60,10 +58,8 @@ Book::print_smob (SCM, SCM p, scm_print_state*)
   return 1;
 }
 
-/*
-  This function does not dump the output; outname is required eg. for
-  dumping header fields.
- */
+/* This function does not dump the output; outname is required eg. for
+   dumping header fields.  */
 Paper_book *
 Book::process (String outname, Output_def *default_def)
 {
@@ -83,12 +79,18 @@ Book::process (String outname, Output_def *default_def)
       SCM systems = scores_[i]->book_rendering (outname,
                                                paper_book->bookpaper_,
                                                default_def);
-      if (systems != SCM_UNDEFINED)
+      
+      /* If the score is empty, generate no output.  Should we
+        do titling?  */
+      if (systems != SCM_EOL
+         /* FIXME: can systems be SCM_UNDEFINED at all?
+            it seesm to be initialise with SCM_EOL and only gets assigned
+            non-SCM_UNDEFINED values -- jcn  */
+         && systems != SCM_UNDEFINED)
        {
          Score_lines sc;
          sc.lines_ = systems;
          sc.header_ = header_;
-
          paper_book->score_lines_.push (sc);
        }
     }
index 42ea516f91568d60d9e5581723503a43ba507de7..e9c7f4da3c8785b4794a7ad4b7535443f7b12876 100644 (file)
@@ -1,55 +1,22 @@
 /*   
   translator-def.cc --  implement Context_def
-  
+
   source file of the GNU LilyPond music typesetter
-  
+
   (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
+*/
 
-/*
-  TODO: should junk this class an replace by
-  a single list of context modifications?
- */
+/* TODO: should junk this class an replace by
+   a single list of context modifications?  */
 
-#include "lily-proto.hh"
 #include "context-def.hh"
-#include "translator-group.hh"
-#include "warn.hh"
+#include "engraver.hh"
+#include "lily-proto.hh"
 #include "output-def.hh"
-#include "ly-smobs.icc"
-#include "score-context.hh"
-
 #include "performer.hh"
-#include "engraver.hh"
-
-int
-Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
-{
-  Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
-
-  scm_puts ("#<Context_def ", port);
-  scm_display (me->context_name_, port);
-  scm_puts (">", port);
-  return 1;
-}
-
-
-SCM
-Context_def::mark_smob (SCM smob)
-{
-  Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
-
-  scm_gc_mark (me->description_);
-  scm_gc_mark (me->context_aliases_);
-  scm_gc_mark (me->accept_mods_);
-  scm_gc_mark (me->translator_mods_);
-  scm_gc_mark (me->property_ops_);  
-  scm_gc_mark (me->translator_group_type_);
-
-  return me->context_name_;
-}
-
+#include "score-context.hh"
+#include "translator-group.hh"
+#include "warn.hh"
 
 Context_def::Context_def ()
 {
@@ -66,10 +33,6 @@ Context_def::Context_def ()
   context_name_ = ly_symbol2scm ("");
 }
 
-Context_def::~Context_def ()
-{
-}
-
 Context_def::Context_def (Context_def const & s)
   : Input (s)
 {
@@ -92,15 +55,48 @@ Context_def::Context_def (Context_def const & s)
   context_name_ = s.context_name_;
 }
 
+Context_def::~Context_def ()
+{
+}
+
+#include "ly-smobs.icc"
+IMPLEMENT_SMOBS (Context_def);
+IMPLEMENT_DEFAULT_EQUAL_P (Context_def);
+
+int
+Context_def::print_smob (SCM smob, SCM port, scm_print_state*)
+{
+  Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
+
+  scm_puts ("#<Context_def ", port);
+  scm_display (me->context_name_, port);
+  scm_puts (">", port);
+  return 1;
+}
+
+SCM
+Context_def::mark_smob (SCM smob)
+{
+  Context_def* me = (Context_def*) SCM_CELL_WORD_1 (smob);
+
+  scm_gc_mark (me->description_);
+  scm_gc_mark (me->context_aliases_);
+  scm_gc_mark (me->accept_mods_);
+  scm_gc_mark (me->translator_mods_);
+  scm_gc_mark (me->property_ops_);  
+  scm_gc_mark (me->translator_group_type_);
+
+  return me->context_name_;
+}
 
 void
 Context_def::add_context_mod (SCM mod)
 {
-  SCM tag  = ly_car (mod);
-  if (ly_symbol2scm ("description")  == tag)
+  SCM tag = ly_car (mod);
+  if (ly_symbol2scm ("description") == tag)
     {
       description_ = ly_cadr (mod);
-      return ;
+      return;
     }
 
   SCM sym = ly_cadr (mod);
@@ -112,43 +108,30 @@ Context_def::add_context_mod (SCM mod)
       || ly_symbol2scm ("remove") == tag)
     {
       if (!get_translator (sym))
-       error (_f ("Program has no such type: `%s'", ly_symbol2string (sym).to_str0 ()));
+       error (_f ("Program has no such type: `%s'",
+                  ly_symbol2string (sym).to_str0 ()));
       else
-       translator_mods_ = scm_cons (scm_list_2 (tag, sym), translator_mods_ );
+       translator_mods_ = scm_cons (scm_list_2 (tag, sym), translator_mods_);
     }
   else if (ly_symbol2scm ("accepts") == tag
           || ly_symbol2scm ("denies") == tag)
-    {
-      accept_mods_ = scm_cons (scm_list_2 (tag, sym), accept_mods_); 
-    }
+    accept_mods_ = scm_cons (scm_list_2 (tag, sym), accept_mods_); 
   else if (ly_symbol2scm ("poppush") == tag
           || ly_symbol2scm ("pop") == tag
           || ly_symbol2scm ("push") == tag
           || ly_symbol2scm ("assign") == tag
           || ly_symbol2scm ("unset") == tag)
-    {
-      property_ops_ = scm_cons (mod, property_ops_);
-    }
+    property_ops_ = scm_cons (mod, property_ops_);
   else if (ly_symbol2scm ("alias") == tag)
-    {
-      context_aliases_ = scm_cons (sym, context_aliases_);
-    }
+    context_aliases_ = scm_cons (sym, context_aliases_);
   else if (ly_symbol2scm ("translator-type")  == tag)
-    {
-      translator_group_type_ = sym;
-    }
+    translator_group_type_ = sym;
   else if (ly_symbol2scm ("context-name")  == tag)
-    {
-      context_name_ = sym;
-    }
+    context_name_ = sym;
   else
-    {
-      programming_error ("Unknown context mod tag.");
-    }
+    programming_error ("Unknown context mod tag.");
 }
 
-
-
 SCM
 Context_def::get_context_name () const
 {
@@ -158,8 +141,7 @@ Context_def::get_context_name () const
 SCM
 Context_def::get_accepted (SCM user_mod) const
 {
-  SCM mods = scm_reverse_x (scm_list_copy (accept_mods_),
-                           user_mod);
+  SCM mods = scm_reverse_x (scm_list_copy (accept_mods_), user_mod);
   SCM acc = SCM_EOL;
   for (SCM s = mods; ly_c_pair_p (s); s = ly_cdr (s))
     {
@@ -173,9 +155,8 @@ Context_def::get_accepted (SCM user_mod) const
   return acc;
 }
 
-          
 Link_array<Context_def>
-Context_def::path_to_acceptable_context (SCM type_sym, Output_defodef) const
+Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
 {
   assert (ly_c_symbol_p (type_sym));
   
@@ -183,26 +164,22 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def* odef) const
 
   Link_array<Context_def> accepteds;
   for (SCM s = accepted; ly_c_pair_p (s); s = ly_cdr (s))
-    {
-      Context_def *t = unsmob_context_def (find_context_def (odef, ly_car (s)));
-      if (!t)
-       continue;
+    if (Context_def *t = unsmob_context_def (find_context_def (odef,
+                                                              ly_car (s))))
       accepteds.push (t);
-    }
 
   Link_array<Context_def> best_result;
   for (int i=0; i < accepteds.size (); i++)
     {
-      /*
-       don't check aliases, because \context Staff should not create RhythmicStaff.
-      */
+      /* do not check aliases, because \context Staff should not
+        create RhythmicStaff. */
       if (ly_c_equal_p (accepteds[i]->get_context_name (), type_sym))
        {
          best_result.push (accepteds[i]);
          return best_result;
        }
     }
-      
+
   int best_depth= INT_MAX;
   for (int i=0; i < accepteds.size (); i++)
     {
@@ -215,10 +192,8 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def* odef) const
          result.insert (g,0);
          best_result = result;
 
-         /*
-           this following line was added in 1.9.3, but hsould've been
-           there all along... Let's hope it doesn't cause nightmares.
-          */
+         /* this following line was added in 1.9.3, but hsould've been
+            there all along... Let's hope it doesn't cause nightmares.  */
          best_depth = result.size ();
        }
     }
@@ -226,18 +201,13 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def* odef) const
   return best_result;
 }
 
-IMPLEMENT_SMOBS (Context_def);
-IMPLEMENT_DEFAULT_EQUAL_P (Context_def);
-
-
 SCM
 Context_def::get_translator_names (SCM user_mod) const
 {
   SCM l1 = SCM_EOL;
   SCM l2 = SCM_EOL;
 
-  SCM mods = scm_reverse_x (scm_list_copy (translator_mods_),
-                           user_mod);
+  SCM mods = scm_reverse_x (scm_list_copy (translator_mods_), user_mod);
   
   for (SCM s = mods; ly_c_pair_p (s); s = ly_cdr (s))
     {
@@ -257,15 +227,13 @@ Context_def::get_translator_names (SCM user_mod) const
          l2 = scm_delete_x (arg, l2);
        }
     }
-
   return scm_append_x (scm_list_2 (l1, l2));
 }
 
-
 SCM
-filter_performers (SCM l)
+filter_performers (SCM ell)
 {
-  for (SCM *tail = &l; ly_c_pair_p (*tail); tail = SCM_CDRLOC (*tail))
+  for (SCM *tail = &ell; ly_c_pair_p (*tail); tail = SCM_CDRLOC (*tail))
     {
       if (dynamic_cast<Performer*> (unsmob_translator (ly_car (*tail))))
        {
@@ -274,14 +242,13 @@ filter_performers (SCM l)
            break ;
        }
     }
-  return l;
+  return ell;
 }
 
-
 SCM
-filter_engravers (SCM l)
+filter_engravers (SCM ell)
 {
-  SCM *tail = &l;  
+  SCM *tail = &ell;  
   for (; ly_c_pair_p (*tail) ; tail = SCM_CDRLOC (*tail))
     {
       if (dynamic_cast<Engraver*> (unsmob_translator (ly_car (*tail))))
@@ -291,14 +258,14 @@ filter_engravers (SCM l)
            break ;
        }
     }
-  return l;
+  return ell;
 }
 
 
 Context *
 Context_def::instantiate (SCM ops)
 {
-  Context * tg =  0;
+  Context *tg =  0;
 
   if (context_name_ == ly_symbol2scm ("Score"))
     tg = new Score_context ();
@@ -309,27 +276,25 @@ Context_def::instantiate (SCM ops)
 
   SCM trans_names = get_translator_names (ops); 
 
-  Translator * g = get_translator (translator_group_type_);
+  Translator *g = get_translator (translator_group_type_);
   g = g->clone ();
   
-  g->simple_trans_list_ =  SCM_EOL;
+  g->simple_trans_list_ = SCM_EOL;
 
   for (SCM s = trans_names; ly_c_pair_p (s) ; s = ly_cdr (s))
     {
-      Translator * t = get_translator (ly_car (s));
+      Translator *t = get_translator (ly_car (s));
       if (!t)
        warning (_f ("can't find: `%s'", s));
       else
        {
-         Translator * tr = t->clone ();
+         Translator *tr = t->clone ();
          SCM str = tr->self_scm ();
          g->simple_trans_list_ = scm_cons (str, g->simple_trans_list_);
          tr->daddy_context_ = tg;
          scm_gc_unprotect_object (str);
        }
     }
-
-
   
   tg->implementation_ = g->self_scm ();
   if (dynamic_cast<Engraver*> (g))
@@ -347,12 +312,10 @@ Context_def::instantiate (SCM ops)
   return tg;
 }
 
-
 SCM
 Context_def::clone_scm () const
 {
   Context_def * t = new Context_def (*this);
-
   SCM x = t->self_scm ();
   scm_gc_unprotect_object (x);
   return x;
@@ -362,8 +325,7 @@ SCM
 Context_def::make_scm ()
 {
   Context_def* t = new Context_def;
-
-  SCM x  =t->self_scm ();
+  SCM x = t->self_scm ();
   scm_gc_unprotect_object (x);
   return x;
 }
@@ -371,25 +333,28 @@ Context_def::make_scm ()
 void
 Context_def::apply_default_property_operations (Context *tg)
 {
-  apply_property_operations (tg , property_ops_);
+  apply_property_operations (tg, property_ops_);
 }
 
 SCM
 Context_def::to_alist () const
 {
-  SCM l = SCM_EOL;
-
-  l = scm_cons (scm_cons (ly_symbol2scm ("consists"),
-                       get_translator_names (SCM_EOL)), l);
-  l = scm_cons (scm_cons (ly_symbol2scm ("description"),  description_), l);
-  l = scm_cons (scm_cons (ly_symbol2scm ("aliases"),  context_aliases_), l);
-  l = scm_cons (scm_cons (ly_symbol2scm ("accepts"),  get_accepted (SCM_EOL)), l);
-  l = scm_cons (scm_cons (ly_symbol2scm ("property-ops"),  property_ops_), l);
-  l = scm_cons (scm_cons (ly_symbol2scm ("context-name"),  context_name_), l);
+  SCM ell = SCM_EOL;
+
+  ell = scm_cons (scm_cons (ly_symbol2scm ("consists"),
+                           get_translator_names (SCM_EOL)), ell);
+  ell = scm_cons (scm_cons (ly_symbol2scm ("description"), description_), ell);
+  ell = scm_cons (scm_cons (ly_symbol2scm ("aliases"), context_aliases_), ell);
+  ell = scm_cons (scm_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)),
+                 ell);
+  ell = scm_cons (scm_cons (ly_symbol2scm ("property-ops"), property_ops_),
+                 ell);
+  ell = scm_cons (scm_cons (ly_symbol2scm ("context-name"), context_name_),
+                 ell);
 
   if (ly_c_symbol_p (translator_group_type_))
-    l = scm_cons (scm_cons (ly_symbol2scm ("group-type"),  translator_group_type_), l);    
-
-  return l;  
+    ell = scm_cons (scm_cons (ly_symbol2scm ("group-type"),
+                             translator_group_type_), ell);    
+  return ell;  
 }
 
index 3740b09f9a63149962110f66d5e9c5959489714d..82f5a506c29b4258a69b2fac5a4af898ad4adfdb 100644 (file)
@@ -128,7 +128,7 @@ Duration::less_p (SCM p1, SCM p2)
     return SCM_BOOL_F;
 }
 
-LY_DEFINE (duration_less, "ly:duration<?",
+LY_DEFINE (ly_duration_less_p, "ly:duration<?",
           2, 0, 0, (SCM p1, SCM p2),
          "Is @var{p1} shorter than @var{p2}?")
 {
@@ -144,7 +144,7 @@ LY_DEFINE (duration_less, "ly:duration<?",
     return SCM_BOOL_F;
 }
 
-LY_DEFINE (make_duration, "ly:make-duration",
+LY_DEFINE (ly_make_duration, "ly:make-duration",
           1, 3, 0, (SCM length, SCM dotcount, SCM num, SCM den),
           "@var{length} is the negative logarithm (base 2) of the duration:\n"
           "1 is a half note, 2 is a quarter note, 3 is an eighth\n"
@@ -193,7 +193,7 @@ LY_DEFINE (make_duration, "ly:make-duration",
   return p.smobbed_copy ();
 }
 
-LY_DEFINE (duration_log, "ly:duration-log",
+LY_DEFINE (ly_duration_log, "ly:duration-log",
           1, 0, 0, (SCM dur),
          "Extract the duration log from @var{dur}")
 {
@@ -201,15 +201,14 @@ LY_DEFINE (duration_log, "ly:duration-log",
   return scm_int2num (unsmob_duration (dur)->duration_log ());
 }
 
-LY_DEFINE (dot_count_log, "ly:duration-dot-count", 1, 0, 0, (SCM dur),
-         "Extract the dot count from @var{dur}"
-)
+LY_DEFINE (ly_duration_dot_count, "ly:duration-dot-count",
+          1, 0, 0, (SCM dur),
+         "Extract the dot count from @var{dur}")
 {
   SCM_ASSERT_TYPE (unsmob_duration (dur), dur, SCM_ARG1, __FUNCTION__, "duration");
   return scm_int2num (unsmob_duration (dur)->dot_count ());
 }
 
-
 LY_DEFINE (ly_intlog2, "ly:intlog2",
           1, 0, 0, (SCM d),
          "The 2-logarithm of 1/@var{d}.")
@@ -219,7 +218,7 @@ LY_DEFINE (ly_intlog2, "ly:intlog2",
   return scm_int2num (log);
 }
 
-LY_DEFINE (compression_factor, "ly:duration-factor",
+LY_DEFINE (ly_duration_factor, "ly:duration-factor",
           1, 0, 0, (SCM dur),
          "Extract the compression factor from @var{dur}. Return as a pair.")
 {
index 740491f52a1b32a20a9f0a20b67fc9a0af3176c0..05eedf65127ed08a170fb86105e3e8190af3a28a 100644 (file)
 #include "system.hh"
 
 
-LY_DEFINE (ly_grob_set_property,"ly:grob-set-property!", 3, 0, 0,
- (SCM grob, SCM sym, SCM val),
-  "Set @var{sym} in grob @var{grob} to value @var{val}")
+LY_DEFINE (ly_grob_set_property_x, "ly:grob-set-property!",
         3, 0, 0, (SCM grob, SCM sym, SCM val),
+          "Set @var{sym} in grob @var{grob} to value @var{val}")
 {
-  Grob * sc = unsmob_grob (grob);
+  Grob *sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE (ly_c_symbol_p (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
 
@@ -30,7 +30,7 @@ LY_DEFINE (ly_grob_set_property,"ly:grob-set-property!", 3, 0, 0,
   return SCM_UNSPECIFIED;
 }
 
-LY_DEFINE (ly_get_property, "ly:grob-property",
+LY_DEFINE (ly_grob_property, "ly:grob-property",
           2, 0, 0, (SCM grob, SCM sym),
          "Return the value of a value in grob @var{g} of property @var{sym}. "
           "It will return @code{' ()} (end-of-list) "
@@ -45,8 +45,8 @@ LY_DEFINE (ly_get_property, "ly:grob-property",
   return sc->internal_get_property (sym);
 }
 
-LY_DEFINE (spanner_get_bound, "ly:spanner-get-bound", 2 , 0, 0,
-          (SCM slur, SCM dir),
+LY_DEFINE (ly_spanner_get_bound, "ly:spanner-get-bound",
+          2, 0, 0, (SCM slur, SCM dir),
           "Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} "
           "for left, and @code{1} for right.")
 {
@@ -58,9 +58,9 @@ LY_DEFINE (spanner_get_bound, "ly:spanner-get-bound", 2 , 0, 0,
 
 /* TODO: make difference between scaled and unscalead variable in
    calling (i.e different funcs.) */
-LY_DEFINE (ly_grob_paper,"ly:grob-paper", 1, 0, 0,
- (SCM g),
-  "Get @code{\\paper} definition from grob @var{g}.")
+LY_DEFINE (ly_grob_paper, "ly:grob-paper",
         1, 0, 0, (SCM g),
+          "Get @code{\\paper} definition from grob @var{g}.")
 {
   Grob * sc = unsmob_grob (g);
   SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
@@ -68,45 +68,42 @@ LY_DEFINE (ly_grob_paper,"ly:grob-paper", 1, 0, 0,
   return sc->get_paper ()->self_scm ();
 }
 
-
-LY_DEFINE(ly_grob_alist_chain, "ly:grob-alist-chain",
-         1, 1, 0,
-         (SCM g, SCM global),
-         "Get an alist chain for grob @var{g}, with @var{global} as the "
-         "global default. If unspecified, @code{font-defaults} "
-         "from the paper block is taken. "
-         )
+LY_DEFINE (ly_grob_alist_chain, "ly:grob-alist-chain",
+          1, 1, 0, (SCM g, SCM global),
+          "Get an alist chain for grob @var{g}, with @var{global} as the "
+          "global default. If unspecified, @code{font-defaults} "
+          "from the paper block is taken. ")
 {
-  Grob * sc = unsmob_grob (g);
+  Grob *sc = unsmob_grob (g);
   SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
 
   if (global == SCM_UNDEFINED)
-    global = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+    global
+      = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
 
   return sc->get_property_alist_chain (global);
 }
 
-
-LY_DEFINE (ly_get_extent, "ly:grob-extent", 3, 0, 0,
-          (SCM grob, SCM refp, SCM axis),
+LY_DEFINE (ly_get_extent, "ly:grob-extent",
+          3, 0, 0, (SCM grob, SCM refp, SCM axis),
           "Get the extent in @var{axis} direction of @var{grob} relative to "
           "the grob @var{refp}")
 {
-  Grob * sc = unsmob_grob (grob);
-  Grob * ref = unsmob_grob (refp);
+  Grob *sc = unsmob_grob (grob);
+  Grob *ref = unsmob_grob (refp);
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE (ref, refp, SCM_ARG2, __FUNCTION__, "grob");
-
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG3, __FUNCTION__, "axis");
 
   return ly_interval2scm ( sc->extent (ref, Axis (ly_scm2int (axis))));
 }
 
-LY_DEFINE (ly_get_parent, "ly:grob-parent", 2, 0, 0, (SCM grob, SCM axis),
+LY_DEFINE (ly_grob_parent, "ly:grob-parent",
+          2, 0, 0, (SCM grob, SCM axis),
           "Get the parent of @var{grob}.  @var{axis} is 0 for the X-axis, "
           "1 for the Y-axis.")
 {
-  Grob * sc = unsmob_grob (grob);
+  Grob *sc = unsmob_grob (grob);
   SCM_ASSERT_TYPE (sc, grob, SCM_ARG1, __FUNCTION__, "grob");
   SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
 
@@ -114,7 +111,7 @@ LY_DEFINE (ly_get_parent, "ly:grob-parent", 2, 0, 0, (SCM grob, SCM axis),
   return par ? par->self_scm () : SCM_EOL;
 }
 
-LY_DEFINE (ly_get_system, "ly:grob-system",
+LY_DEFINE (ly_grob_system, "ly:grob-system",
           1, 0, 0, (SCM g),
           "Return the System Grob of @var{g}.")
 {
@@ -127,7 +124,7 @@ LY_DEFINE (ly_get_system, "ly:grob-system",
   return SCM_EOL;
 }
 
-LY_DEFINE (ly_get_original, "ly:grob-original",
+LY_DEFINE (ly_grob_original, "ly:grob-original",
           1, 0, 0, (SCM grob),
           "Return the unbroken original Grob of @var{grob}.")
 {
@@ -136,10 +133,9 @@ LY_DEFINE (ly_get_original, "ly:grob-original",
   return me->original_ ? me->original_->self_scm () : me->self_scm ();
 }
 
-/* FIXME: ly prefix? spanner in name? */
 /* TODO: maybe we should return a vector -- random access is more
    logical for this list? */
-LY_DEFINE (get_broken_into, "ly:spanner-broken-into",
+LY_DEFINE (ly_spanner_broken_into, "ly:spanner-broken-into",
           1, 0, 0, (SCM spanner),
           "Return broken-into list for @var{spanner}.")
 {
index 3696cf495464be2df7c3e7ed83a7044ca038d8dd..7846df26665834ebb7fad38740780f9a58824ded 100644 (file)
@@ -1,12 +1,12 @@
-/*   
-identifier-smob.cc -- implement glue to pass Scheme expressions off as
-identifiers.
+/*
+  identifier-smob.cc -- implement glue to pass Scheme expressions off as
+  identifiers.
 
-source file of the GNU LilyPond music typesetter
-
-(c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  source file of the GNU LilyPond music typesetter
 
+  (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
+
 #include "identifier-smob.hh"
 
 
@@ -25,16 +25,16 @@ print_box (SCM b, SCM port, scm_print_state *)
   return 1;
 }
 
-
 /* This defines the primitve `make-box', which returns a new smob of
    type `box', initialized to `#f'.  */
-LY_DEFINE (package_identifier, "ly:export", 1,0,0, (SCM arg),
-         "Export a Scheme object to the parser, so it is treated as an identifier.")
+LY_DEFINE (ly_export, "ly:export",
+          1, 0, 0, (SCM arg),
+          "Export a Scheme object to the parser, "
+          "so it is treated as an identifier.")
 {
   SCM_RETURN_NEWSMOB (package_tag, arg);
 }
 
-
 SCM
 unpack_identifier (SCM box)
 {
@@ -51,4 +51,5 @@ init_box_type (void)
   scm_set_smob_mark (package_tag, scm_markcdr);
   scm_set_smob_print (package_tag, print_box);
 }
+
 ADD_SCM_INIT_FUNC (package, init_box_type); 
index 89d13eb8a6092c8dc09c69940187b991b1332647..9d2e54095ec36f46d652ca0ea1e486684b678b54 100644 (file)
@@ -14,7 +14,7 @@
 
 SCM ly_make_anonymous_module (bool safe);
 void ly_import_module (SCM dest, SCM src);
-SCM ly_module_to_alist (SCM mod);
+SCM ly_module2alist (SCM mod);
 SCM ly_module_lookup (SCM module, SCM sym);
 SCM ly_modules_lookup (SCM modules, SCM sym, SCM);
 SCM ly_module_symbols (SCM mod);
index 1c03bf92cb2e7cd33057928e7838036d6ebeae5e..c21e7e7a437b624b1c6fbf7469fb804345bffa46 100644 (file)
@@ -4,8 +4,7 @@
   source file of the GNU LilyPond music typesetter
 
   (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
-
-  Han-Wen Nienhuys <hanwen@cs.uu.nl>
+                 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 
@@ -173,8 +172,9 @@ index_set_cell (SCM s, Direction d, SCM v)
   return s;
 }
   
-LY_DEFINE (ly_warning,"ly:warn", 1, 0, 0,
-  (SCM str), "Scheme callable function to issue the warning @code{msg}.")
+LY_DEFINE (ly_warn, "ly:warn",
+          1, 0, 0, (SCM str),
+          "Scheme callable function to issue the warning @code{msg}.")
 {
   SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string");
   progress_indication ("\n");
@@ -182,7 +182,8 @@ LY_DEFINE (ly_warning,"ly:warn", 1, 0, 0,
   return SCM_BOOL_T;
 }
 
-LY_DEFINE (ly_dir_p,  "ly:dir?", 1,0, 0,  (SCM s),
+LY_DEFINE (ly_dir_p, "ly:dir?",
+          1, 0, 0, (SCM s),
          "type predicate. A direction is @code{-1}, @code{0} or "
           "@code{1}, where @code{-1} represents "
          "left or down and @code{1} represents right or up.")
@@ -198,7 +199,8 @@ LY_DEFINE (ly_dir_p,  "ly:dir?", 1,0, 0,  (SCM s),
 bool
 is_number_pair (SCM p)
 {
-  return ly_c_pair_p (p) && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p));
+  return ly_c_pair_p (p)
+    && ly_c_number_p (ly_car (p)) && ly_c_number_p (ly_cdr (p));
 }
 
 typedef void (*Void_fptr) ();
@@ -212,7 +214,6 @@ void add_scm_init_func (void (*f) ())
   scm_init_funcs_->push (f);
 }
 
-
 void
 ly_init_ly_module (void *)
 {
@@ -234,13 +235,12 @@ ly_c_init_guile ()
   scm_c_use_module ("lily");
 }
 
-unsigned int ly_scm_hash (SCM s)
+unsigned int
+ly_scm_hash (SCM s)
 {
   return scm_ihashv (s, ~1u);
 }
 
-
-
 bool
 is_direction (SCM s)
 {
@@ -252,7 +252,6 @@ is_direction (SCM s)
   return false;
 }
 
-
 bool
 is_axis (SCM s)
 {
@@ -315,7 +314,6 @@ appendable_list_append (SCM l, SCM elt)
   scm_set_car_x (l, newcons);
 }
 
-
 SCM
 ly_offset2scm (Offset o)
 {
@@ -329,7 +327,6 @@ ly_scm2offset (SCM s)
                 ly_scm2double (ly_cdr (s)));
 }
 
-   
 LY_DEFINE (ly_number2string, "ly:number->string",
           1, 0, 0, (SCM s),
           "Convert @var{num} to a string without generating many decimals.")
index 6b2317eaad6aa4b1db9fb2bf3db4a5ccc5c74049..6e344e60776aa553fdf0b96219c2600b9c20f112 100644 (file)
@@ -104,9 +104,9 @@ entry_to_alist (void *closure, SCM key, SCM val, SCM result)
   return scm_cons (scm_cons (key, scm_variable_ref (val)), result);
 }
 
-LY_DEFINE(ly_module_to_alist, "ly:module->alist",
-         1,0,0, (SCM mod),
-         "Dump the contents of  module @var{mod} as an alist.")
+LY_DEFINE (ly_module2alist, "ly:module->alist",
+          1, 0, 0, (SCM mod),
+          "Dump the contents of  module @var{mod} as an alist.")
 {
   SCM_VALIDATE_MODULE (1, mod);
   SCM obarr= SCM_MODULE_OBARRAY (mod);
@@ -125,28 +125,27 @@ ly_module_lookup (SCM module, SCM sym)
 #undef FUNC_NAME
 }
 
-/*
-  Lookup SYM in a list of modules, which do not have to be related.
-  Return the first instance.
- */
-LY_DEFINE(ly_modules_lookup, "ly:modules-lookup",
-         2, 1, 0,
-         (SCM modules, SCM sym, SCM def),
-         "Lookup @var{sym} in the list @var{modules}, returning the "
-         "first occurence. If not found, return @var{default}, or @code{#f}.")
+/* Lookup SYM in a list of modules, which do not have to be related.
+   Return the first instance. */
+LY_DEFINE (ly_modules_lookup, "ly:modules-lookup",
+          2, 1, 0,
+          (SCM modules, SCM sym, SCM def),
+          "Lookup @var{sym} in the list @var{modules}, "
+          "returning the first occurence.  "
+          "If not found, return @var{default}, or @code{#f}.")
 {
   for (SCM s = modules; ly_c_pair_p (s); s = ly_cdr (s))
     {
       SCM mod = ly_car (s);      
-      SCM v = scm_sym2var (sym, scm_module_lookup_closure (mod), SCM_UNDEFINED);
-      if (SCM_VARIABLEP(v)  && SCM_VARIABLE_REF(v) != SCM_UNDEFINED)
+      SCM v = scm_sym2var (sym, scm_module_lookup_closure (mod),
+                          SCM_UNDEFINED);
+      if (SCM_VARIABLEP(v) && SCM_VARIABLE_REF(v) != SCM_UNDEFINED)
        return SCM_VARIABLE_REF(v);
     }
 
   if (def != SCM_UNDEFINED)
     return def;
-  else
-    return SCM_BOOL_F;
+  return SCM_BOOL_F;
 }
 
 void
index edd24f8cd698b18128083d06e50b63c77afef365..54ee65c1842ec074cb034167bbe76c2b0636d8a6 100644 (file)
@@ -1,18 +1,39 @@
 /*   
   moment.cc --  implement Moment
-  
+
   source file of the GNU LilyPond music typesetter
-  
-  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-  
- */
 
+  (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
 
 #include "lily-guile.hh"
 #include "moment.hh"
 #include "warn.hh"
-#include "ly-smobs.icc"
 
+
+Moment::Moment ()
+{
+}
+
+Moment::Moment (int m)
+{
+  main_part_ = Rational (m);
+  grace_part_ = Rational ( 0);
+}
+
+Moment::Moment (Rational m, Rational g)
+{
+  main_part_ = m;
+  grace_part_ = g;
+}
+
+Moment::Moment (Rational m)
+{
+  main_part_ = m;
+  grace_part_ = Rational (0);
+}
+
+#include "ly-smobs.icc"
 IMPLEMENT_SIMPLE_SMOBS (Moment);
 IMPLEMENT_TYPE_P (Moment, "ly:moment?");
 
@@ -22,9 +43,6 @@ Moment::mark_smob (SCM)
   return SCM_EOL;
 }
 
-
-
-
 int
 Moment::print_smob (SCM s, SCM port, scm_print_state *)
 {
@@ -38,19 +56,18 @@ Moment::print_smob (SCM s, SCM port, scm_print_state *)
   return 1;
 }
 
-/*
-  TODO: add optional factor argument.
-*/
-LY_DEFINE (make_moment,"ly:make-moment", 2,2,0, (SCM n, SCM d, SCM gn, SCM gd),
+/* TODO: add optional factor argument. */
+LY_DEFINE (ly_make_moment, "ly:make-moment",
+          2, 2, 0, (SCM n, SCM d, SCM gn, SCM gd),
           "Create the rational number with main timing @var{n}/@var{d}, "
           "and optional grace timin @var{gn}/@var{gd}.\n"
           "\n"
           "\n"
-          "Moment is a point in musical time. It is consists of a pair of\n"
-          "rationals (@var{m},@var{g}), where @var{m} is the timing for the  main\n"
-          "notes, and @var{g} the timing for  grace notes. In absence of grace\n"
-          "notes, @var{g} is zero.\n"
-          )
+          "Moment is a point in musical time.  "
+          "It is consists of a pair of rationals (@var{m},@var{g}), "
+          "where @var{m} is the timing for the main\n"
+          "notes, and @var{g} the timing for grace notes.  "
+          "In absence of grace notes, @var{g} is zero.\n")
 {
   SCM_ASSERT_TYPE (SCM_INUMP (n), n, SCM_ARG1, __FUNCTION__, "integer");
   SCM_ASSERT_TYPE (SCM_INUMP (d), d, SCM_ARG2, __FUNCTION__, "integer");
@@ -73,58 +90,50 @@ LY_DEFINE (make_moment,"ly:make-moment", 2,2,0, (SCM n, SCM d, SCM gn, SCM gd),
                 Rational (grace_num, grace_den)).smobbed_copy ();
 }
 
-LY_DEFINE (add_moment,"ly:add-moment", 2,0,0, (SCM a, SCM b),
-          "Add two moments."
-          )
+LY_DEFINE (ly_add_moment, "ly:add-moment",
+          2, 0, 0, (SCM a, SCM b),
+          "Add two moments.")
 {
-  Moment * ma = unsmob_moment (a);
-  Moment * mb = unsmob_moment (b);
+  Moment *ma = unsmob_moment (a);
+  Moment *mb = unsmob_moment (b);
   SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
   SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
-
   return (*ma + *mb).smobbed_copy ();
 }
 
-
-LY_DEFINE (mul_moment,"ly:mul-moment", 2,0,0, (SCM a, SCM b),
-          "Multiply two moments."
-          )
+LY_DEFINE (ly_mul_moment,"ly:mul-moment",
+          2, 0, 0, (SCM a, SCM b),
+          "Multiply two moments.")
 {
-  Moment * ma = unsmob_moment (a);
-  Moment * mb = unsmob_moment (b);
+  Moment *ma = unsmob_moment (a);
+  Moment *mb = unsmob_moment (b);
   SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
   SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
-
-  return (*ma *  *mb).smobbed_copy ();
+  return (*ma * *mb).smobbed_copy ();
 }
 
-
-
-LY_DEFINE (div_moment,"ly:div-moment", 2,0,0, (SCM a, SCM b),
-          "Divide two moments."
-          )
+LY_DEFINE (ly_div_moment,"ly:div-moment",
+          2, 0, 0, (SCM a, SCM b),
+          "Divide two moments.")
 {
-  Moment * ma = unsmob_moment (a);
-  Moment * mb = unsmob_moment (b);
+  Moment *ma = unsmob_moment (a);
+  Moment *mb = unsmob_moment (b);
   SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
   SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
-
-  return (*ma /  *mb).smobbed_copy ();
+  return (*ma / *mb).smobbed_copy ();
 }
 
-LY_DEFINE (ly_moment_less_p,"ly:moment<?", 2,0,0, (SCM a, SCM b),
+LY_DEFINE (ly_moment_less_p,"ly:moment<?",
+          2, 0, 0, (SCM a, SCM b),
           "Compare two moments.")
 {
-  Moment * ma = unsmob_moment (a);
-  Moment * mb = unsmob_moment (b);
+  Moment *ma = unsmob_moment (a);
+  Moment *mb = unsmob_moment (b);
   SCM_ASSERT_TYPE (ma, a, SCM_ARG1, __FUNCTION__, "moment");
   SCM_ASSERT_TYPE (mb, b, SCM_ARG2, __FUNCTION__, "moment");
-
   return ly_bool2scm (*ma <  *mb);
 }
 
-
-
 SCM
 Moment::equal_p (SCM a, SCM b)
 {
@@ -152,29 +161,6 @@ Moment::compare (Moment const &a, Moment const &b)
   return Rational::compare (a.grace_part_, b.grace_part_);
 }
 
-Moment::Moment ()
-{
-
-}
-
-Moment::Moment (int m)
-{
-  main_part_ = Rational (m);
-  grace_part_  = Rational ( 0);
-}
-
-Moment::Moment (Rational m, Rational g)
-{
-  main_part_ = m;
-  grace_part_  = g;
-}
-
-Moment::Moment (Rational m)
-{
-  main_part_ = m;
-  grace_part_  = Rational (0);
-}
-
 void
 Moment::operator += (Moment const &src)
 {
@@ -208,13 +194,17 @@ Moment::operator /= (Moment const &src)
   grace_part_ /= src.main_part_;
 }
 
-
-
 int
-Moment::den () const { return main_part_.den (); }
+Moment::den () const
+{
+  return main_part_.den ();
+}
 
 int
-Moment::num () const { return main_part_.num (); }
+Moment::num () const
+{
+  return main_part_.num ();
+}
 
 bool
 Moment::to_bool () const
@@ -228,7 +218,6 @@ Moment::set_infinite (int k)
   main_part_.set_infinite (k);
 }
 
-
 String
 Moment::to_string () const
 {
index e98cd9a5d608d84c024a7f97d943d1c18d26f1f0..bd9c938a3c1e97367b8c1a406dc45f11248268c0 100644 (file)
@@ -8,7 +8,6 @@
 */
 
 #include "book.hh"
-
 #include "file-name.hh"
 #include "file-path.hh"
 #include "lily-version.hh"
@@ -23,8 +22,6 @@
 #include "source.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
-
 
 My_lily_parser::My_lily_parser (Sources *sources)
 {
@@ -58,6 +55,8 @@ My_lily_parser::~My_lily_parser ()
   // FIXME: Memleak: del lexer
 }
 
+#include "ly-smobs.icc"
+
 IMPLEMENT_SMOBS (My_lily_parser);
 IMPLEMENT_TYPE_P (My_lily_parser, "ly:my-lily-parser?");
 IMPLEMENT_DEFAULT_EQUAL_P (My_lily_parser);
@@ -66,6 +65,7 @@ SCM
 My_lily_parser::mark_smob (SCM s)
 {
   My_lily_parser *parser = (My_lily_parser*) ly_cdr (s);
+  (void) parser;
   return SCM_EOL;
 }
 
@@ -208,8 +208,8 @@ My_lily_parser::here_input () const
 bool store_locations_global_b;
 
 /* Do not append `!' suffix, since 1st argument is not modified. */
-LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click", 1, 0, 0,
-         (SCM what),
+LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click",
+          1, 0, 0, (SCM what),
          "Set the options for Point-and-click source specials output. The\n"
 "argument is a symbol.  Possible options are @code{none} (no source specials),\n"
 "@code{line} and @code{line-column}")
@@ -228,8 +228,7 @@ LY_DEFINE (ly_set_point_and_click, "ly:set-point-and-click", 1, 0, 0,
 }
 
 LY_DEFINE (ly_parse_file, "ly:parse-file",
-          1, 0, 0,
-          (SCM name),
+          1, 0, 0, (SCM name),
           "Parse a single @code{.ly} file.  "
           "Upon failure, throw @code{ly-file-failed} key.")
 {
@@ -297,8 +296,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file",
 }
 
 LY_DEFINE (ly_parse_string, "ly:parse-string",
-          1, 0, 0,
-          (SCM ly_code),
+          1, 0, 0, (SCM ly_code),
           "Parse the string LY_CODE.  "
           "Upon failure, throw @code{ly-file-failed} key.")
 {
@@ -316,23 +314,19 @@ LY_DEFINE (ly_parse_string, "ly:parse-string",
 }
 
 LY_DEFINE (ly_clone_parser, "ly:clone-parser",
-           1, 0, 0, 
-           (SCM parser_smob),
+           1, 0, 0, (SCM parser_smob),
            "Return a clone of PARSER_SMOB.")
 {
   My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   My_lily_parser *clone = new My_lily_parser (*parser);
 
-  /*
-    FIXME: should copy scopes too.
-   */
+  /* FIXME: should copy scopes too. */
   return scm_gc_unprotect_object (clone->self_scm ());
 }
 
-LY_DEFINE(ly_parser_define, "ly:parser-define",
-          3, 0, 0, 
-          (SCM parser_smob, SCM symbol, SCM val),
-          "Bind SYMBOL to VAL in PARSER_SMOB's module.")
+LY_DEFINE (ly_parser_define, "ly:parser-define",
+          3, 0, 0, (SCM parser_smob, SCM symbol, SCM val),
+          "Bind SYMBOL to VAL in PARSER_SMOB's module.")
 {
   My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
   SCM_ASSERT_TYPE (ly_c_symbol_p (symbol), symbol, SCM_ARG2, __FUNCTION__, "symbol");
@@ -342,10 +336,11 @@ LY_DEFINE(ly_parser_define, "ly:parser-define",
   parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
   return SCM_UNSPECIFIED;
 }
-LY_DEFINE(ly_parser_lookup, "ly:parser-lookup",
-          2, 0, 0, 
-          (SCM parser_smob, SCM symbol),
-          "Lookup @var{symbol} in @var{parser_smob}'s module. Undefined is '().")
+
+LY_DEFINE (ly_parser_lookup, "ly:parser-lookup",
+          2, 0, 0, (SCM parser_smob, SCM symbol),
+          "Lookup @var{symbol} in @var{parser_smob}'s module.  "
+          "Undefined is '().")
 {
   My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
 
@@ -360,12 +355,10 @@ LY_DEFINE(ly_parser_lookup, "ly:parser-lookup",
 }
 
 LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string",
-          2, 0, 0,
-          (SCM parser_smob, SCM ly_code),
+          2, 0, 0, (SCM parser_smob, SCM ly_code),
           "Parse the string LY_CODE with PARSER_SMOB."
           "Upon failure, throw @code{ly-file-failed} key.")
 {
-
   My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
 
   SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser");
@@ -412,10 +405,8 @@ get_bookpaper (My_lily_parser *parser)
 }
 
 
-/*
-  TODO: move this to Scheme? Why take the parser arg, and all the back
-  & forth between scm and c++?
- */
+/* TODO: move this to Scheme?  Why take the parser arg, and all the back
+   & forth between scm and c++? */
 LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
           2, 0, 0,
           (SCM parser_smob, SCM score_smob),
@@ -455,11 +446,11 @@ LY_DEFINE (ly_parser_print_score, "ly:parser-print-score",
 }
 
 
-LY_DEFINE (ly_parser_set_names, "ly:parser-set-note-names",
-          2, 0, 0,
-          (SCM parser, SCM names),
-          "Replace current note names in @var{parser}. @var{names} is an alist of "
-          "symbols. This only has effect if the current mode is notes.")
+LY_DEFINE (ly_parser_set_note_names, "ly:parser-set-note-names",
+          2, 0, 0, (SCM parser, SCM names),
+          "Replace current note names in @var{parser}. "
+          "@var{names} is an alist of symbols.  "
+          "This only has effect if the current mode is notes.")
 {
   My_lily_parser *p = unsmob_my_lily_parser (parser);
   SCM_ASSERT_TYPE(p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
@@ -474,8 +465,7 @@ LY_DEFINE (ly_parser_set_names, "ly:parser-set-note-names",
 }
 
 LY_DEFINE (ly_parser_print_book, "ly:parser-print-book",
-          2, 0, 0,
-          (SCM parser_smob, SCM book_smob),
+          2, 0, 0, (SCM parser_smob, SCM book_smob),
           "Print book.")
 {
   My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
index 0363aef752da7142babdebe4af37b8df0f9b6978..10dbc0f783309be2e45c7c97eb5b097f4feb81c2 100644 (file)
@@ -6,10 +6,10 @@
   (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-
 #include "context-def.hh"
 #include "file-path.hh"
 #include "global-context.hh"
+#include "interval.hh"
 #include "lily-guile.hh"
 #include "ly-module.hh"
 #include "main.hh"
@@ -18,8 +18,6 @@
 #include "scm-hash.hh"
 #include "warn.hh"
 
-#include "ly-smobs.icc"
-
 Output_def::Output_def ()
 {
   scope_ = SCM_EOL;
@@ -29,10 +27,6 @@ Output_def::Output_def ()
   scope_ = ly_make_anonymous_module (false);
 }
 
-Output_def::~Output_def ()
-{
-}
-
 Output_def::Output_def (Output_def const &s)
 {
   scope_ = SCM_EOL;
@@ -45,30 +39,32 @@ Output_def::Output_def (Output_def const &s)
     ly_import_module (scope_, s.scope_);
 }
 
+Output_def::~Output_def ()
+{
+}
 
+#include "ly-smobs.icc"
 IMPLEMENT_SMOBS (Output_def);
 IMPLEMENT_DEFAULT_EQUAL_P (Output_def);
 
-
 SCM
 Output_def::mark_smob (SCM m)
 {
-  Output_def * mo = (Output_def*) SCM_CELL_WORD_1 (m);
+  Output_def *mo = (Output_def*) SCM_CELL_WORD_1 (m);
 
-  /*
-    FIXME: why is this necessary?
-    all bookpaper_ should be protected by themselves.
-  */
+  /* FIXME: why is this necessary?
+     all bookpaper_ should be protected by themselves. */
   if (mo->parent_)
     scm_gc_mark (mo->parent_->self_scm ());
-  
 
   mo->derived_mark ();
   return mo->scope_;
 }
 
 void
-Output_def::derived_mark () {}
+Output_def::derived_mark ()
+{
+}
 
 void
 assign_context_def (Output_def * m, SCM transdef)
@@ -83,9 +79,7 @@ assign_context_def (Output_def * m, SCM transdef)
     }  
 }
 
-/*
-  find the translator for NAME. NAME must be a symbol.
-*/
+/* find the translator for NAME. NAME must be a symbol. */
 SCM
 find_context_def (Output_def const *m, SCM name)
 {  
@@ -112,7 +106,6 @@ Output_def::get_dimension (SCM s) const
   return ly_scm2double (val);
 }
 
-
 SCM
 Output_def::lookup_variable (SCM sym) const
 {
@@ -151,7 +144,7 @@ LY_DEFINE (ly_paper_lookup, "ly:output-def-lookup",
 }
 
 LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
-          1, 0,0, (SCM def),
+          1, 0, 0, (SCM def),
           "Get the variable scope inside @var{def}.")
 {
   Output_def *op = unsmob_output_def (def);
@@ -159,7 +152,6 @@ LY_DEFINE (ly_output_def_scope, "ly:output-def-scope",
   return op->scope_;
 }
 
-
 LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
           1, 0, 0, (SCM def),
           "Get the parent output-def of @var{def}.")
@@ -169,7 +161,6 @@ LY_DEFINE (ly_output_def_parent, "ly:output-def-parent",
   return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
 }
 
-
 LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
           1, 0, 0, (SCM def),
           "Clone @var{def}.")
@@ -181,41 +172,32 @@ LY_DEFINE (ly_output_def_clone, "ly:output-def-clone",
   return s;
 }
 
-LY_DEFINE(ly_output_description, "ly:output-description",
-         1,0,0,
-         (SCM output_def),
-         "Return the description of translators in @var{output-def}.")
+LY_DEFINE (ly_output_description, "ly:output-description",
+          1, 0, 0, (SCM output_def),
+          "Return the description of translators in @var{output-def}.")
 {
   Output_def *id = unsmob_output_def (output_def);
   
-  SCM al =ly_module_to_alist (id->scope_);
+  SCM al = ly_module2alist (id->scope_);
 
-  SCM l = SCM_EOL;
-  for (SCM s = al ; ly_c_pair_p (s); s = ly_cdr (s))
+  SCM ell = SCM_EOL;
+  for (SCM s = al; ly_c_pair_p (s); s = ly_cdr (s))
     {
       Context_def * td = unsmob_context_def (ly_cdar (s));
       SCM key = ly_caar (s);
       if (td && key == td->get_context_name ())
-       {
-         
-         l = scm_cons (scm_cons (key, td->to_alist ()),  l);
-       }
+       ell = scm_cons (scm_cons (key, td->to_alist ()),  ell);
     }
-  return l;  
+  return ell;  
 }
   
-
-
-#include "interval.hh"
-
 /* FIXME.  This is broken until we have a generic way of
    putting lists inside the \paper block.  */
 Interval
 line_dimensions_int (Output_def *def, int n)
 {
-  Real lw =  def->get_dimension (ly_symbol2scm ("linewidth"));
+  Real lw = def->get_dimension (ly_symbol2scm ("linewidth"));
   Real ind = n ? 0.0 : def->get_dimension (ly_symbol2scm ("indent"));
-
   return Interval (ind, lw);
 }
 
@@ -226,11 +208,8 @@ LY_DEFINE (ly_paper_def_p, "ly:paper-def?",
   return ly_bool2scm (unsmob_output_def (def));
 }
 
-
-
 LY_DEFINE (ly_bookpaper_outputscale, "ly:bookpaper-outputscale",
-         1, 0, 0,
-         (SCM bp),
+         1, 0, 0, (SCM bp),
          "Get outputscale for BP.")
 {
   Output_def *b = unsmob_output_def (bp);
@@ -238,8 +217,6 @@ LY_DEFINE (ly_bookpaper_outputscale, "ly:bookpaper-outputscale",
   return scm_make_real (output_scale (b));
 }
 
-
-
 LY_DEFINE (ly_make_output_def, "ly:make-output-def",
           0, 0, 0, (),
           "Make a output def.")
@@ -248,3 +225,4 @@ LY_DEFINE (ly_make_output_def, "ly:make-output-def",
   return scm_gc_unprotect_object (bp->self_scm ());
 }
 
+
index f4ab0c0d91d3d118eb5bfe1916f2933827f5235f..a25c0dedab83fc4e9be8eda8e3c08356075d518c 100644 (file)
@@ -106,7 +106,8 @@ LY_DEFINE (ly_output_formats, "ly:output-formats",
   Array<String> output_formats = split_string (output_format_global, ',');
 
   SCM lst = SCM_EOL;
-  for (int i = 0; i < output_formats.size (); i ++)
+  int output_formats_count = output_formats.size ();
+  for (int i = 0; i < output_formats_count; i ++)
     lst = scm_cons (scm_makfrom0str (output_formats[i].to_str0 ()), lst);
   
   return lst; 
@@ -118,17 +119,15 @@ Paper_book::output (String outname)
   if (!score_lines_.size ())
     return;
 
-  
   /* Generate all stencils to trigger font loads.  */
   pages ();
-
   
   SCM formats = ly_output_formats();
   for (SCM s = formats; ly_c_pair_p (s); s = ly_cdr (s)) 
     {
       String format = ly_scm2string (ly_car (s));
-      
-      Paper_outputter *out = get_paper_outputter (outname + "." + format, format);
+      Paper_outputter *out = get_paper_outputter (outname + "." + format,
+                                                 format);
   
       SCM scopes = SCM_EOL;
       if (ly_c_module_p (header_))
@@ -143,22 +142,19 @@ Paper_book::output (String outname)
                                     scopes,
                                     dump_fields (),
                                     scm_makfrom0str (outname.to_str0 ()),
-                                    SCM_UNDEFINED
-                                    )) ;
+                                    SCM_UNDEFINED));
 
       scm_gc_unprotect_object (out->self_scm ());
+      progress_indication ("\n");
     }
 }
 
-
 void
 Paper_book::classic_output (String outname)
 {
-
   /* Generate all stencils to trigger font loads.  */
   lines ();
 
-
   // ugh code dup
   SCM scopes = SCM_EOL;
   if (ly_c_module_p (header_))
@@ -168,7 +164,6 @@ Paper_book::classic_output (String outname)
     scopes = scm_cons (score_lines_[0].header_, scopes);
   //end ugh
 
-
   Array<String> output_formats = split_string (output_format_global, ',');
 
   for (int i = 0; i < output_formats.size (); i++)
@@ -178,41 +173,30 @@ Paper_book::classic_output (String outname)
       func_nm = "output-classic-framework-" + func_nm;
       
       SCM func = ly_scheme_function (func_nm.to_str0 ());
+      Paper_outputter *out = get_paper_outputter (outname + "." + format,
+                                                 format);
 
-      Paper_outputter *out = get_paper_outputter (outname + "." + format, format);
-
-      scm_apply_0 (func, scm_list_n (out->self_scm (),
-                                    self_scm (),
-                                    scopes,
+      scm_apply_0 (func, scm_list_5 (out->self_scm (), self_scm (), scopes,
                                     dump_fields (),
-                                    scm_makfrom0str (outname.to_str0 ()),
-                                    SCM_UNDEFINED
-                                    )) ;
+                                    scm_makfrom0str (outname.to_str0 ())));
 
       scm_gc_unprotect_object (out->self_scm ());
+      progress_indication ("\n");
     }
-  
-  progress_indication ("\n");
 }
 
-
-
-
-LY_DEFINE(ly_paper_book_pages, "ly:paper-book-pages",
-         1,0,0,
-         (SCM pb),
+LY_DEFINE (ly_paper_book_pages, "ly:paper-book-pages",
+         1, 0, 0, (SCM pb),
          "Return pages in book PB.")
 {
   return unsmob_paper_book(pb)->pages ();
 }
 
-
-LY_DEFINE(ly_paper_book_scopes, "ly:paper-book-scopes",
-         1,0,0,
-         (SCM book),
+LY_DEFINE (ly_paper_book_scopes, "ly:paper-book-scopes",
+         1, 0, 0, (SCM book),
          "Return pages in paper book @var{book}.")
 {
-  Paper_book * pb =  unsmob_paper_book(book);
+  Paper_book *pb = unsmob_paper_book(book);
   SCM_ASSERT_TYPE(pb, book, SCM_ARG1, __FUNCTION__, "Paper_book");
   
   SCM scopes = SCM_EOL;
@@ -222,29 +206,21 @@ LY_DEFINE(ly_paper_book_scopes, "ly:paper-book-scopes",
   return scopes;
 }
 
-
-LY_DEFINE(ly_paper_book_lines, "ly:paper-book-lines",
-         1,0,0,
-         (SCM pb),
-         "Return lines in book PB.")
+LY_DEFINE (ly_paper_book_lines, "ly:paper-book-lines",
+          1, 0, 0, (SCM pb),
+          "Return lines in book PB.")
 {
   return unsmob_paper_book (pb)->lines ();
 }
 
-
-LY_DEFINE(ly_paper_book_book_paper, "ly:paper-book-book-paper",
-         1,0,0,
-         (SCM pb),
+LY_DEFINE (ly_paper_book_book_paper, "ly:paper-book-book-paper",
+         1, 0, 0, (SCM pb),
          "Return pages in book PB.")
 {
-  return unsmob_paper_book(pb)->bookpaper_->self_scm ();
+  return unsmob_paper_book (pb)->bookpaper_->self_scm ();
 }
 
-/*
-
-TODO: resurrect more complex user-tweaks for titling? 
-
-*/
+/* TODO: resurrect more complex user-tweaks for titling?  */
 Stencil
 Paper_book::book_title ()
 {
@@ -271,8 +247,6 @@ Paper_book::book_title ()
   return title;
 }
 
-  
-
 Stencil
 Paper_book::score_title (int i)
 {
@@ -298,18 +272,16 @@ Paper_book::score_title (int i)
   if (unsmob_stencil (tit))
     title = *unsmob_stencil (tit);
 
-
   if (!title.is_empty ())
     title.align_to (Y_AXIS, UP);
   
   return title;
 }
   
-
 SCM
 Paper_book::lines ()
 {
-  if (SCM_BOOL_F != lines_)
+  if (lines_ != SCM_BOOL_F)
     return lines_;
 
   lines_ = SCM_EOL;
@@ -318,7 +290,6 @@ Paper_book::lines ()
   if (!title.is_empty ())
     {
       Paper_system *pl = new Paper_system (title, true);
-      
       lines_ = scm_cons (pl->self_scm (), lines_);
       scm_gc_unprotect_object (pl->self_scm ());
     }
@@ -336,7 +307,8 @@ Paper_book::lines ()
       
       if (scm_vector_p (score_lines_[i].lines_) == SCM_BOOL_T)
        {
-         SCM line_list = scm_vector_to_list (score_lines_[i].lines_); // guh.
+         // guh.         
+         SCM line_list = scm_vector_to_list (score_lines_[i].lines_);
 
          line_list = scm_reverse (line_list);
          lines_ = scm_append (scm_list_2 (line_list, lines_));
@@ -346,24 +318,21 @@ Paper_book::lines ()
   lines_ = scm_reverse (lines_);
   
   int i = 0;
-  Paper_system * last = 0;
+  Paper_system *last = 0;
   for (SCM s = lines_; s != SCM_EOL; s = ly_cdr (s))
     {
       Paper_system * p = unsmob_paper_line (ly_car (s));
       p->number_ = ++i;
 
       if (last && last->is_title ())
-       {
-         p->penalty_ = 10000;  // ugh, hardcoded.
-       }
+       // ugh, hardcoded.      
+       p->penalty_ = 10000;
       last = p;
     }
-
   
   return lines_;
 }
 
-
 SCM
 Paper_book::pages ()
 {
@@ -371,20 +340,13 @@ Paper_book::pages ()
     return pages_;
 
   pages_ = SCM_EOL;
-  
   Output_def *paper = bookpaper_;
-
   SCM proc = paper->c_variable ("page-breaking");
-  pages_ = scm_apply_0 (proc, scm_list_n (lines (),
-                                         self_scm (),
-                                         SCM_UNDEFINED));
-
+  pages_ = scm_apply_0 (proc, scm_list_2 (lines (), self_scm ()));
   return pages_;
 }
 
 
-
-
 /****************************************************************/
 
 Score_lines::Score_lines ()
index c384996375858f717afe55cebcb0bb1965998c67..809b8dbd78946c1e8790fcee4c6b616e38dc5165 100644 (file)
@@ -112,7 +112,6 @@ get_paper_outputter (String outname, String f)
   progress_indication (_f ("paper output to `%s'...",
                           outname == "-" ? String ("<stdout>") : outname));
   return new Paper_outputter (outname, f);
-
 }
 
 /* FIXME: why is output_* wrapper called dump?  */
index 9d4024b18a4c73c2dc4912366dd62cc9316f3478..9d58682b0c3638c5a8309630a6e122057a22d4f1 100644 (file)
@@ -6,25 +6,22 @@
   (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
-#include "score.hh"
-#include "main.hh"
-#include "warn.hh"
+#include "all-font-metrics.hh"
 #include "font-metric.hh"
-#include "spanner.hh"
+#include "gourlay-breaking.hh"
+#include "ly-module.hh"
+#include "main.hh"
+#include "misc.hh"
 #include "output-def.hh"
-#include "system.hh"
+#include "paper-book.hh"
 #include "paper-column.hh"
 #include "paper-score.hh"
-#include "paper-column.hh"
 #include "scm-hash.hh"
-#include "gourlay-breaking.hh"
-//#include "paper-outputter.hh"
-#include "misc.hh"
-#include "all-font-metrics.hh"
-
+#include "score.hh"
+#include "spanner.hh"
 #include "stencil.hh"
-#include "paper-book.hh"
-#include "ly-module.hh"
+#include "system.hh"
+#include "warn.hh"
 
 Paper_score::Paper_score ()
 {
@@ -53,7 +50,7 @@ Paper_score::typeset_line (System *system)
 Array<Column_x_positions>
 Paper_score::calc_breaking ()
 {
-  Break_algorithm *algorithm=0;
+  Break_algorithm *algorithm = 0;
   Array<Column_x_positions> sol;
 
   algorithm = new Gourlay_breaking ;
@@ -87,8 +84,11 @@ Paper_score::process (String)
   Array<Column_x_positions> breaking = calc_breaking ();
   system_->break_into_pieces (breaking);
   SCM lines = system_->get_lines ();
+#if 0
+  /* gourlay:do_solve also prints newline.  */
   progress_indication ("\n");
-
+#endif
+  
   /* Only keep result stencils in lines_, *title_; delete all grobs.  */
   systems_ = SCM_EOL;
   
index 8004d2fe6530284976da2ddb356699549ada7615..4f1b17a5c1e3e3819853d3d25559248cfebbd4b3 100644 (file)
@@ -291,7 +291,7 @@ Pitch::less_p (SCM p1, SCM p2)
 }
 
 /* Should add optional args.  */
-LY_DEFINE (make_pitch, "ly:make-pitch",
+LY_DEFINE (ly_make_pitch, "ly:make-pitch",
           3, 0, 0, (SCM octave, SCM note, SCM alter),
           "@var{octave} is specified by an integer, "
           "zero for the octave containing middle C.  "
@@ -308,7 +308,7 @@ LY_DEFINE (make_pitch, "ly:make-pitch",
   return p.smobbed_copy ();
 }
 
-LY_DEFINE (pitch_steps, "ly:pitch-steps", 1, 0, 0,
+LY_DEFINE (ly_pitch_steps, "ly:pitch-steps", 1, 0, 0,
           (SCM p),
           "Number of steps counted from middle C of the pitch @var{p}.")
 {
@@ -317,7 +317,7 @@ LY_DEFINE (pitch_steps, "ly:pitch-steps", 1, 0, 0,
   return scm_int2num (pp->steps ());
 }
 
-LY_DEFINE (pitch_octave, "ly:pitch-octave",
+LY_DEFINE (ly_pitch_octave, "ly:pitch-octave",
           1, 0, 0, (SCM pp),
           "Extract the octave from pitch @var{p}.")
 {
@@ -327,7 +327,7 @@ LY_DEFINE (pitch_octave, "ly:pitch-octave",
   return scm_int2num (q);
 }
 
-LY_DEFINE (pitch_alteration, "ly:pitch-alteration",
+LY_DEFINE (ly_pitch_alteration, "ly:pitch-alteration",
           1, 0, 0, (SCM pp),
           "Extract the alteration from pitch  @var{p}.")
 {
@@ -348,7 +348,7 @@ LY_DEFINE (pitch_notename, "ly:pitch-notename",
   return scm_int2num (q);
 }
 
-LY_DEFINE (ly_pitch_quartertones,  "ly:pitch-quartertones",
+LY_DEFINE (ly_pitch_quartertones, "ly:pitch-quartertones",
           1, 0, 0, (SCM pp),
           "Calculate the number of quarter tones of @var{p} from middle C.")
 {
@@ -358,7 +358,7 @@ LY_DEFINE (ly_pitch_quartertones,  "ly:pitch-quartertones",
   return scm_int2num (q);
 }
 
-LY_DEFINE (ly_pitch_semitones,  "ly:pitch-semitones",
+LY_DEFINE (ly_pitch_semitones, "ly:pitch-semitones",
           1, 0, 0, (SCM pp),
           "calculate the number of semitones of @var{p} from middle C.")
 {
@@ -368,7 +368,7 @@ LY_DEFINE (ly_pitch_semitones,  "ly:pitch-semitones",
   return scm_int2num (q);
 }
 
-LY_DEFINE (pitch_less, "ly:pitch<?",
+LY_DEFINE (ly_pitch_less_p, "ly:pitch<?",
           2, 0, 0, (SCM p1, SCM p2),
           "Is @var{p1} lexicographically smaller than @var{p2}?")
 {
@@ -397,9 +397,8 @@ LY_DEFINE (ly_pitch_diff, "ly:pitch-diff",
   return interval (*r, *p).smobbed_copy ();
 }
 
-
 int
-Pitch::get_octave ()const
+Pitch::get_octave () const
 {
   return octave_;
 }
index 05d976d1b53e60b3413fc5f625b35901b0b3ce99..a86868d965b3b5e104741d9ccd6c1f90464a0de1 100644 (file)
@@ -26,9 +26,7 @@
 #include "score.hh"
 #include "warn.hh"
 
-/*
-  TODO: junkme.
- */
+/*  TODO: junkme.  */
 Score::Score ()
   : Input ()
 {
@@ -64,18 +62,12 @@ Score::print_smob (SCM , SCM p, scm_print_state*)
   return 1;
 }
 
-
-
-/*
-  store point & click locations.
-  Global to save some time. (Sue us!)
- */
 Score::Score (Score const &s)
   : Input (s)
 {
   music_ = SCM_EOL;
 
-  // FIXME: SCM_EOL?
+  /* FIXME: SCM_EOL? */
   header_ = 0;
 
   smobify_self ();
@@ -93,7 +85,7 @@ Score::Score (Score const &s)
 }
 
 LY_DEFINE (ly_run_translator, "ly:run-translator", 
-         2, 0, 0, (SCM mus, SCM output_def),
+          2, 0, 0, (SCM mus, SCM output_def),
           "Process @var{mus} according to @var{output_def}. "
           "An interpretation context is set up, "
           "and @var{mus} is interpreted with it.  "
@@ -102,12 +94,15 @@ LY_DEFINE (ly_run_translator, "ly:run-translator",
   Output_def *odef = unsmob_output_def (output_def);
   Music *music = unsmob_music (mus);
 
+  if (!music)
+    return SCM_BOOL_F;
+
   SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
   SCM_ASSERT_TYPE (odef, output_def, SCM_ARG2, __FUNCTION__, "Output definition");
   
   Cpu_timer timer;
   
-  Global_context * trans = new Global_context (odef, music->get_length ());
+  Global_context *trans = new Global_context (odef, music->get_length ());
   
   if (!trans)
     {
@@ -151,7 +146,7 @@ LY_DEFINE (ly_format_output, "ly:format-output",
 
   Music_output *output = g->get_output ();
   progress_indication ("\n");
-  // ugh, midi still wants outname
+  /* ugh, midi still wants outname  */
   return output->process (ly_scm2string (outname));
 }
 
@@ -165,25 +160,23 @@ default_rendering (SCM music, SCM outdef,
   
   Output_def *bpd = unsmob_output_def (book_outputdef);
 
-  /*
-    ugh.
-   */
+  /* ugh.  */
   if (bpd->c_variable ("is-bookpaper") == SCM_BOOL_T)
     {
       Real scale = ly_scm2double (bpd->c_variable ("outputscale"));
       
-      Output_def * def = scale_output_def (unsmob_output_def (outdef), scale);
+      Output_def *def = scale_output_def (unsmob_output_def (outdef), scale);
       scaled_def = def->self_scm ();
 
       scaled_bookdef = scale_output_def (bpd, scale)->self_scm ();
-      unsmob_output_def (scaled_def)->parent_ = unsmob_output_def (scaled_bookdef);
+      unsmob_output_def (scaled_def)->parent_
+       = unsmob_output_def (scaled_bookdef);
       
       scm_gc_unprotect_object (scaled_bookdef);
       scm_gc_unprotect_object (scaled_def);
     }
   
   SCM context = ly_run_translator (music, scaled_def);
-
   if (Global_context *g = dynamic_cast<Global_context*>
       (unsmob_context (context)))
     {
@@ -191,9 +184,7 @@ default_rendering (SCM music, SCM outdef,
       Music_output *output = g->get_output ();
       if (systems != SCM_UNDEFINED)
        {
-         /*
-           ugh, this is strange, Paper_book without a Book object.
-          */
+         /* ugh, this is strange, Paper_book without a Book object. */
          Paper_book *paper_book = new Paper_book ();
          paper_book->header_ = header;
          paper_book->bookpaper_ = unsmob_output_def (scaled_bookdef);
@@ -214,9 +205,7 @@ default_rendering (SCM music, SCM outdef,
   scm_remember_upto_here_1 (scaled_bookdef);
 }
 
-/*
-  PAPERBOOK should be scaled already.
- */
+/*  PAPERBOOK should be scaled already.  */
 SCM
 Score::book_rendering (String outname,
                       Output_def *paperbook,
@@ -226,9 +215,7 @@ Score::book_rendering (String outname,
   Real scale = 1.0;
 
   if (paperbook && paperbook->c_variable ("is-bookpaper") == SCM_BOOL_T)
-    {
-      scale = ly_scm2double (paperbook->c_variable ("outputscale"));
-    }
+    scale = ly_scm2double (paperbook->c_variable ("outputscale"));
   
   SCM out = scm_makfrom0str (outname.to_str0 ());
   SCM systems = SCM_EOL;
@@ -245,18 +232,13 @@ Score::book_rendering (String outname,
          scm_gc_unprotect_object (scaled);
        }
 
-      /*
-       TODO: fix or junk --no-paper.
-       */
-      
+      /* TODO: fix or junk --no-paper.  */
       SCM context = ly_run_translator (music_, def->self_scm ());
       if (dynamic_cast<Global_context*> (unsmob_context (context)))
        {
          SCM s = ly_format_output (context, out);
          if (s != SCM_UNDEFINED)
-           {
-             systems = s;
-           }
+           systems = s;
        }
 
       scm_remember_upto_here_1 (scaled);
@@ -285,8 +267,9 @@ LY_DEFINE (ly_score_bookify, "ly:score-bookify",
 
 LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
           2, 0, 0, (SCM score, SCM paper),
-          "Run @var{score} through @var{paper}, a output definition, "
-          " scaled to correct outputscale already,  return a list of paper-lines. ")
+          "Run @var{score} through @var{paper}, an output definition, "
+          "scaled to correct outputscale already, "
+          "return a list of paper-lines.")
 {
   Score * sc = unsmob_score (score);
   Output_def *od = unsmob_output_def (paper);
@@ -297,32 +280,21 @@ LY_DEFINE (ly_score_embedded_format, "ly:score-embedded-format",
   SCM lines = SCM_EOL;
   Output_def * score_def  = 0;
 
-  /*
-    UGR, FIXME, these are default \paper blocks once again. They suck.
-   */
+  /* UGR, FIXME, these are default \paper blocks once again.  They
+     suck. */
   for (int i = 0; !score_def && i < sc->defs_.size (); i++)
-    {
-      if (sc->defs_[i]->c_variable ("is-paper") == SCM_BOOL_T)
-       {
-         score_def = sc->defs_[i];
-       }
-    }
+    if (sc->defs_[i]->c_variable ("is-paper") == SCM_BOOL_T)
+      score_def = sc->defs_[i];
 
   if (!score_def)
     return lines;
-  
       
   score_def = score_def->clone ();
   SCM prot = score_def->self_scm ();
   scm_gc_unprotect_object (prot);
 
-  /*
-
-  TODO: SCORE_DEF should be scaled according to OD->parent_ or OD
-  itself.
-  
-   */
-  
+  /* TODO: SCORE_DEF should be scaled according to OD->parent_ or OD
+     itself. */
   score_def->parent_ = od;
   
   SCM context = ly_run_translator (sc->music_, score_def->self_scm ());
index b7a70bd4627daac4d24b18791042525774bd37b1..faddd44efc856788be3c4e57d099370d5e4179c5 100644 (file)
@@ -23,7 +23,7 @@ Script_column::add_staff_sided (Grob *me, Item *i)
   me->add_dependency (i);
 }
 
-LY_DEFINE (grob_script_priority_less, "ly:grob-script-priority-less",
+LY_DEFINE (ly_grob_script_priority_less, "ly:grob-script-priority-less",
          2, 0, 0, (SCM a, SCM b),
          "Compare two grobs by script priority. For internal use.")
 {
@@ -74,7 +74,7 @@ Script_column::before_line_breaking (SCM smob)
   do
     {
       SCM ss = scm_reverse_x (scripts[d], SCM_EOL);
-      ss = scm_stable_sort_x (ss, grob_script_priority_less_proc);
+      ss = scm_stable_sort_x (ss, ly_grob_script_priority_less_proc);
       
       Grob * last = 0;
       for (SCM s = ss; ly_c_pair_p (s); s = ly_cdr (s))
index da4d81c0cb94640db2c2ca8cb53318af3fd1f192..8f069bba4519e7629ea2561800a7fedc7397b1b1 100644 (file)
@@ -216,7 +216,7 @@ LY_DEFINE (ly_make_stencil, "ly:make-stencil",
 }
 
 
-LY_DEFINE (ly_align_to_x, "ly:stencil-align-to!",
+LY_DEFINE (ly_stencil_align_to_x, "ly:stencil-align-to!",
           3, 0, 0, (SCM stil, SCM axis, SCM dir),
           "Align @var{stil} using its own extents. "
           "@var{dir} is a number -1, 1 are left and right respectively. "
index f8af69c80d279e2212b7151a17ea065f8c9796eb..0d2ce87b9ddbf9996721207b37373f307d7118dc 100644 (file)
@@ -269,7 +269,6 @@ System::pre_processing ()
 
   if (verbose_global_b)
     progress_indication (_f ("Grob count %d", element_count ()));
-
   
   for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
     unsmob_grob (ly_car (s))->handle_prebroken_dependencies ();
@@ -278,11 +277,13 @@ System::pre_processing ()
   
   for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
     {
-      Grobsc = unsmob_grob (ly_car (s));
+      Grob *sc = unsmob_grob (ly_car (s));
       sc->calculate_dependencies (PRECALCED, PRECALCING, ly_symbol2scm ("before-line-breaking-callback"));
     }
   
-  progress_indication ("\n" + _ ("Calculating line breaks...") + " ");
+  progress_indication ("\n");
+  progress_indication (_ ("Calculating line breaks..."));
+  progress_indication (" ");
   for (SCM s = get_property ("all-elements"); ly_c_pair_p (s); s = ly_cdr (s))
     {
       Grob *e = unsmob_grob (ly_car (s));
index 8de6a818a19b309a924abad892cf569eecedfc4e..1acf6f7e8b6767e9078f8ae18571bca411de4eca 100644 (file)
@@ -91,8 +91,8 @@ determines the space between each markup in @var{args}."
 (def-markup-command (combine paper props m1 m2) (markup? markup?)
   "Print two markups on top of each other."
   (let*
-      ((s1   (interpret-markup paper props m1))
-       (s2   (interpret-markup paper props m2)))
+      ((s1 (interpret-markup paper props m1))
+       (s2 (interpret-markup paper props m2)))
             
     (ly:stencil-add s1 s2)))