]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/lily-guile.hh: rename ly_c_X_p -> ly_is_X
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 11 Jul 2005 11:51:43 +0000 (11:51 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 11 Jul 2005 11:51:43 +0000 (11:51 +0000)
* lily/paper-outputter.cc (Paper_outputter): take port argument.

* lily/paper-outputter-scheme.cc (LY_DEFINE): take port argument.

* scm/framework-texstr.scm (output-framework):

54 files changed:
ChangeLog
lily/accidental-engraver.cc
lily/accidental.cc
lily/all-font-metrics.cc
lily/apply-context-iterator.cc
lily/balloon.cc
lily/bar-line.cc
lily/bar-number-engraver.cc
lily/beam.cc
lily/chord-name-engraver.cc
lily/context-def.cc
lily/context-property.cc
lily/dynamic-performer.cc
lily/event.cc
lily/figured-bass-engraver.cc
lily/grob-interface-scheme.cc
lily/grob.cc
lily/hairpin.cc
lily/include/lily-guile.hh
lily/include/paper-outputter.hh
lily/item.cc
lily/key-engraver.cc
lily/lily-guile.cc
lily/mark-engraver.cc
lily/music-function.cc
lily/music-iterator.cc
lily/music.cc
lily/note-collision.cc
lily/note-head.cc
lily/output-property-engraver.cc
lily/paper-book.cc
lily/paper-outputter-scheme.cc
lily/paper-outputter.cc
lily/parser.yy
lily/piano-pedal-engraver.cc
lily/piano-pedal-performer.cc
lily/recording-group-engraver.cc
lily/repeat-acknowledge-engraver.cc
lily/script-engraver.cc
lily/slur-scoring.cc
lily/span-bar-engraver.cc
lily/stencil-scheme.cc
lily/system-start-delimiter-engraver.cc
lily/system-start-delimiter.cc
lily/system.cc
lily/tie-engraver.cc
lily/tie-performer.cc
lily/time-signature-performer.cc
lily/tuplet-engraver.cc
lily/tweak-registration-scheme.cc
scm/framework-ps.scm
scm/framework-svg.scm
scm/framework-tex.scm
scm/framework-texstr.scm

index bff58110e3c94d1e540c8f08b5578d694de67362..6e730da368226f190356d67f91ca3db36e139120 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 2005-07-11  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * scm/framework-*.scm: use port arguments throughout.
+
+       * lily/include/lily-guile.hh: rename ly_c_X_p -> ly_is_X
+
+       * lily/paper-outputter.cc (Paper_outputter): take port argument.
+
+       * lily/paper-outputter-scheme.cc (LY_DEFINE): take port argument.
+
+       * scm/framework-texstr.scm (output-framework): 
+
        * input/regression/repeat-fold.ly (texidoc): remove TeX strings.
 
        * scm/output-lib.scm (tablature-stem-attachment-function):
index a0f30df239e61d4bf4c96c517ef42d15a69d060f..93744e5a7b680a5da9c1e320dc4a0b2c21a5cdc2 100644 (file)
@@ -486,7 +486,7 @@ Accidental_engraver::acknowledge_grob (Grob_info info)
       && Rhythmic_head::has_interface (info.grob ()))
     {
       if (to_boolean (get_property ("harmonicAccidentals"))
-         || !ly_c_equal_p (info.grob ()->get_property ("style"),
+         || !ly_is_equal (info.grob ()->get_property ("style"),
                            ly_symbol2scm ("harmonic")))
        {
          Accidental_entry entry;
index 26909e72a09601325148dca6f495f2dc1e1abe41..9f08691f10614e3bd59ee6588df4c5dff14bf71b 100644 (file)
@@ -57,7 +57,7 @@ Accidental_interface::accurate_boxes (Grob *a, Grob **common)
   if (to_boolean (a->get_property ("cautionary")))
     {
       SCM cstyle = a->get_property ("cautionary-style");
-      parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+      parens = ly_is_equal (cstyle, ly_symbol2scm ("parentheses"));
     }
 
   SCM accs = a->get_property ("accidentals");
@@ -191,8 +191,8 @@ Accidental_interface::print (SCM smob)
   if (caut)
     {
       SCM cstyle = me->get_property ("cautionary-style");
-      parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
-      smaller = ly_c_equal_p (cstyle, ly_symbol2scm ("smaller"));
+      parens = ly_is_equal (cstyle, ly_symbol2scm ("parentheses"));
+      smaller = ly_is_equal (cstyle, ly_symbol2scm ("smaller"));
     }
 
   SCM scm_style = me->get_property ("style");
index 1273a3ae596feeb81160138edaff0a7d2d76ac8d..8c4d40ffc8957d09ef8bc77643653dcc2824c4e8 100644 (file)
@@ -106,7 +106,7 @@ kpathsea_find_file (String name, String ext)
     return path;
 
   SCM kpath = ly_lily_module_constant ("ly:kpathsea-find-file");
-  if (ly_c_procedure_p (kpath))
+  if (ly_is_procedure (kpath))
     {
       SCM kp_result = scm_call_1 (kpath, scm_makfrom0str (name.to_str0 ()));
       if (scm_is_string (kp_result))
index 6f69bbc7b8e8843177122d3c51183d5db6897b70..d263ba1fd7ec0a5838d44c85a8d7e3c239320afe 100644 (file)
@@ -27,7 +27,7 @@ Apply_context_iterator::process (Moment m)
 {
   SCM proc = get_music ()->get_property ("procedure");
 
-  if (ly_c_procedure_p (proc))
+  if (ly_is_procedure (proc))
     scm_call_1 (proc, get_outlet ()->self_scm ());
   else
     get_music ()->origin ()->warning (_ ("\\applycontext argument is not a procedure"));
index df2cf7d30cb292f3ba6cf4561ffa8af73ce265e4..20508d8db3598a13c03125624d91a7f7721ca72c 100644 (file)
@@ -31,7 +31,7 @@ Balloon_interface::print (SCM smob)
   SCM cb = me->get_property ("balloon-original-callback");
   SCM stil = SCM_EOL;
 
-  if (ly_c_procedure_p (cb))
+  if (ly_is_procedure (cb))
     stil = scm_call_1 (cb, smob);
 
   if (!unsmob_stencil (stil))
index ee3e6b0cdd2a741fd51a2a5ae198a2bd9d132490..f8942db710777bf48c81b8c943134f7f0d7c2ae8 100644 (file)
@@ -26,7 +26,7 @@ Bar_line::print (SCM smob)
 
   SCM s = me->get_property ("glyph");
   SCM barsiz_proc = me->get_property ("bar-size-procedure");
-  if (scm_is_string (s) && ly_c_procedure_p (barsiz_proc))
+  if (scm_is_string (s) && ly_is_procedure (barsiz_proc))
     {
       String str = ly_scm2string (s);
       SCM siz = scm_call_1 (barsiz_proc, me->self_scm ());
@@ -180,7 +180,7 @@ Bar_line::before_line_breaking (SCM smob)
       // leave y_extent for spanbar? 
     }
 
-  if (! ly_c_equal_p (g, orig))
+  if (! ly_is_equal (g, orig))
     me->set_property ("glyph", g);
 
   return SCM_UNSPECIFIED;
index b6940890944166a28957ce0e1ad492af76bf6edb..9b8d0bdf86ae5071090912f941a304a10df1800f 100644 (file)
@@ -44,7 +44,7 @@ Bar_number_engraver::process_music ()
        {
          SCM bn = get_property ("currentBarNumber");
          SCM proc = get_property ("barNumberVisibility");
-         if (scm_is_number (bn) && ly_c_procedure_p (proc)
+         if (scm_is_number (bn) && ly_is_procedure (proc)
              && to_boolean (scm_call_1 (proc, bn)))
            {
              create_items ();
index 868470c3b52ae07a6339570c3b7ab32f4e49c870..ed5797fbc3722bf2aa8740fc026643ce45f11969 100644 (file)
@@ -72,7 +72,7 @@ Beam::get_beam_translation (Grob *me)
 {
   SCM func = me->get_property ("space-function");
 
-  if (ly_c_procedure_p (func))
+  if (ly_is_procedure (func))
     {
       SCM s = scm_call_2 (func, me->self_scm (), scm_int2num (get_beam_count (me)));
       return scm_to_double (s);
index 3e8228be8a256d018bec463b505046a634f04fef..2eb1f1a695605ac8f86440c9b6f9a8edb56e4442 100644 (file)
@@ -118,7 +118,7 @@ Chord_name_engraver::process_music ()
 
   SCM s = get_property ("chordChanges");
   if (to_boolean (s) && scm_is_pair (last_chord_)
-      && ly_c_equal_p (chord_as_scm, last_chord_))
+      && ly_is_equal (chord_as_scm, last_chord_))
     chord_name_->set_property ("begin-of-line-visible", SCM_BOOL_T);
 
   last_chord_ = chord_as_scm;
index b5d0d940cc8f0fd7e76a6c043f96a39a22e61dc1..fc9466fb1a6beaf67b86a6c6f582ea6708b36727 100644 (file)
@@ -211,7 +211,7 @@ Context_def::path_to_acceptable_context (SCM type_sym, Output_def *odef) const
     {
       /* do not check aliases, because \context Staff should not
         create RhythmicStaff. */
-      if (ly_c_equal_p (accepteds[i]->get_context_name (), type_sym))
+      if (ly_is_equal (accepteds[i]->get_context_name (), type_sym))
        {
          best_result.push (accepteds[i]);
          return best_result;
index 940643e7660d8d04f80a4893afcf275acfd51f4e..15685b1c22c33c09142cc0020cea4b9767e90e02 100644 (file)
@@ -86,7 +86,7 @@ execute_pushpop_property (Context *trg,
 
          while (prev_alist != daddy)
            {
-             if (ly_c_equal_p (scm_caar (prev_alist), eltprop))
+             if (ly_is_equal (scm_caar (prev_alist), eltprop))
                {
                  prev_alist = scm_cdr (prev_alist);
                  break;
index 71ce23fb7415fd9b39b130aa4655da7a3eb79bac..12312c74c8fd641e699df1a274f44f00903c8d59 100644 (file)
@@ -44,7 +44,7 @@ Dynamic_performer::create_audio_elements ()
       SCM proc = get_property ("dynamicAbsoluteVolumeFunction");
 
       SCM svolume = SCM_EOL;
-      if (ly_c_procedure_p (proc))
+      if (ly_is_procedure (proc))
        {
          // urg
          svolume = scm_call_1 (proc, script_req_->get_property ("text"));
@@ -80,7 +80,7 @@ Dynamic_performer::create_audio_elements ()
            s = scm_makfrom0str ("piano");
 
          SCM eq = get_property ("instrumentEqualizer");
-         if (ly_c_procedure_p (eq))
+         if (ly_is_procedure (eq))
            {
              s = scm_call_1 (eq, s);
            }
index 314ed194d611d4674af1619aab9a5cc2264c654d..efea41680058f633c12568406c64a24ff98c7573 100644 (file)
@@ -27,7 +27,7 @@ Event::length_callback (SCM m)
 Event::Event (SCM i)
   : Music (i)
 {
-  if (!ly_c_procedure_p (length_callback_))
+  if (!ly_is_procedure (length_callback_))
     {
       length_callback_ = length_callback_proc;
     }
index b4f2cd98ea62f86647eb9c63e8baa78c3d42b5d6..a15b12c3e8f35846ad1b220eeac06134e7ae5f5e 100644 (file)
@@ -67,7 +67,7 @@ Figured_bass_engraver::process_music ()
   else if (figures_.size ())
     {
       SCM proc = get_property ("bassFigureFormatFunction");
-      if (ly_c_procedure_p (proc))
+      if (ly_is_procedure (proc))
        {
          SCM l = SCM_EOL;
          SCM *t = &l;
index b58699520992ea51e7e62f12155cd3c714b79460..17737991e7e383f4c3bf7b1666c9f3afee7ec96d 100644 (file)
@@ -17,7 +17,7 @@ LY_DEFINE (ly_add_interface, "ly:add-interface", 3, 0, 0, (SCM a, SCM b, SCM c),
 {
   SCM_ASSERT_TYPE (scm_is_symbol (a), a, SCM_ARG1, __FUNCTION__, "symbol");
   SCM_ASSERT_TYPE (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string");
-  SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
+  SCM_ASSERT_TYPE (ly_is_list (c), c, SCM_ARG3, __FUNCTION__, "list of syms");
   if (!scm_is_vector (all_ifaces))
     all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL);
 
index 548c82f2c84d74f7ab0949c5adc15f62839d0274..87e81ebef90525dc01defa6052551623bc008ca4 100644 (file)
@@ -110,12 +110,12 @@ Grob::Grob (SCM basicprops,
        {
          dim_cache_[a].dimension_ = xt;
        }
-      else if (ly_c_procedure_p (cb))
+      else if (ly_is_procedure (cb))
        {
          dim_cache_[a].dimension_callback_ = cb;
        }
       else if (cb == SCM_EOL
-              && ly_c_procedure_p (get_property ("print-function")))
+              && ly_is_procedure (get_property ("print-function")))
        dim_cache_[a].dimension_callback_ = stencil_extent_proc;
     }
 }
@@ -199,7 +199,7 @@ Grob::calculate_dependencies (int final, int busy, SCM funcname)
     unsmob_grob (scm_car (d))->calculate_dependencies (final, busy, funcname);
 
   SCM proc = internal_get_property (funcname);
-  if (ly_c_procedure_p (proc))
+  if (ly_is_procedure (proc))
     scm_call_1 (proc, this->self_scm ());
 
   status_ = final;
@@ -231,7 +231,7 @@ Grob::get_uncached_stencil () const
   SCM proc = get_property ("print-function");
 
   SCM stil = SCM_EOL;
-  if (ly_c_procedure_p (proc))
+  if (ly_is_procedure (proc))
     stil = scm_apply_0 (proc, scm_list_n (this->self_scm (), SCM_UNDEFINED));
 
   if (Stencil *m = unsmob_stencil (stil))
@@ -419,14 +419,14 @@ bool
 Grob::is_empty (Axis a) const
 {
   return !(scm_is_pair (dim_cache_[a].dimension_)
-          || ly_c_procedure_p (dim_cache_[a].dimension_callback_));
+          || ly_is_procedure (dim_cache_[a].dimension_callback_));
 }
 
 void
 Grob::flush_extent_cache (Axis axis)
 {
   Dimension_cache *d = &dim_cache_[axis];
-  if (ly_c_procedure_p (d->dimension_callback_)
+  if (ly_is_procedure (d->dimension_callback_)
       && scm_is_pair (d->dimension_))
     {
       d->dimension_ = SCM_EOL;
@@ -447,7 +447,7 @@ Grob::extent (Grob *refp, Axis a) const
   SCM dimpair = d->dimension_;
   if (scm_is_pair (dimpair))
     ;
-  else if (ly_c_procedure_p (d->dimension_callback_)
+  else if (ly_is_procedure (d->dimension_callback_)
           && d->dimension_ == SCM_EOL)
     d->dimension_ = scm_call_2 (d->dimension_callback_, self_scm (), scm_int2num (a));
   else
index 5b1eda0e091c7184dc716445bf0eeb12172e2320..0d25cf1bdf9860701c3c55484c622b0293853129 100644 (file)
@@ -37,7 +37,7 @@ Hairpin::after_line_breaking (SCM smob)
   while (flip (&d) != LEFT);
 
   if (broken[LEFT]
-      && ly_c_equal_p (bounds[RIGHT]->get_column ()->get_property ("when"),
+      && ly_is_equal (bounds[RIGHT]->get_column ()->get_property ("when"),
                       bounds[LEFT]->get_property ("when")))
     {
       me->suicide ();
index dd28743ccfcc5bdad32ba9e90f1452a555dedcbd..b0b302b0ffea93e6efc1090f1672fb9dbecb251a 100644 (file)
@@ -72,9 +72,12 @@ inline SCM ly_assoc_front_x (SCM alist, SCM key, SCM val)
 {
   return scm_acons (key, val, scm_assoc_remove_x (alist, key));
 }
-inline bool ly_c_list_p (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
-inline bool ly_c_procedure_p (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
-inline bool ly_c_equal_p (SCM x, SCM y)
+inline bool ly_is_list (SCM x) { return SCM_NFALSEP (scm_list_p (x)); }
+inline bool ly_is_procedure (SCM x) { return SCM_NFALSEP (scm_procedure_p (x)); }
+inline bool ly_is_port (SCM x) { return SCM_NFALSEP (scm_port_p (x)); }
+
+
+inline bool ly_is_equal (SCM x, SCM y)
 {
   return SCM_NFALSEP (scm_equal_p (x, y));
 }
index 77963e84495630177a5e05242b5b97c09d3c7cd8..7f0ec4be104151eea30a43bafc8d09be4ad0498c 100644 (file)
@@ -29,10 +29,10 @@ public:
   DECLARE_SMOBS (Paper_outputter,);
 
 public:
-  SCM file ();
+  SCM file () const;
   SCM dump_string (SCM);
   void output_scheme (SCM scm);
-  Paper_outputter (String nm, String format);
+  Paper_outputter (SCM port, String format);
   SCM scheme_to_string (SCM);
   void output_stencil (Stencil);
   void close ();
index d478d682e23ac07195c3af4e4e41408804d53ed7..1af1ef1a462ce6973a5dc74811d9ea2015ccdfb6 100644 (file)
@@ -156,7 +156,7 @@ Item::handle_prebroken_dependencies ()
     more complicated things.
   */
   SCM vis = get_property ("break-visibility");
-  if (ly_c_procedure_p (vis))
+  if (ly_is_procedure (vis))
     {
       SCM args = scm_list_n (scm_int2num (break_status_dir ()), SCM_UNDEFINED);
       SCM result = scm_apply_0 (vis, args);
index e8ad6ab2b3bf9e55a8f20eb10c9e8ed446d22409..f7fd06fc5254049ae2ff07c2fa0bfc10b811d410 100644 (file)
@@ -80,7 +80,7 @@ Key_engraver::create_key (bool def)
   if (!def)
     {
       SCM vis = get_property ("explicitKeySignatureVisibility");
-      if (ly_c_procedure_p (vis))
+      if (ly_is_procedure (vis))
        item_->set_property ("break-visibility", vis);
     }
 }
index 5b80d8580b4ba4f27bd04b0c635cd4afdc6c53c2..500aa5d178957055539e95eb5d684400b2f103b6 100644 (file)
@@ -453,7 +453,7 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol)
 
   SCM type = scm_object_property (sym, type_symbol);
 
-  if (type != SCM_EOL && !ly_c_procedure_p (type))
+  if (type != SCM_EOL && !ly_is_procedure (type))
     {
       warning (_f ("can't find property type-check for `%s' (%s).",
                   ly_symbol2string (sym).to_str0 (),
@@ -469,7 +469,7 @@ type_check_assignment (SCM sym, SCM val, SCM type_symbol)
   else
     {
       if (val != SCM_EOL
-         && ly_c_procedure_p (type)
+         && ly_is_procedure (type)
          && scm_call_1 (type, val) == SCM_BOOL_F)
        {
          ok = false;
@@ -499,7 +499,7 @@ ly_unique (SCM list)
   for (SCM i = list; scm_is_pair (i); i = scm_cdr (i))
     {
       if (!scm_is_pair (scm_cdr (i))
-         || !ly_c_equal_p (scm_car (i), scm_cadr (i)))
+         || !ly_is_equal (scm_car (i), scm_cadr (i)))
        unique = scm_cons (scm_car (i), unique);
     }
   return scm_reverse_x (unique, SCM_EOL);
@@ -560,7 +560,7 @@ ly_split_list (SCM s, SCM list)
     {
       SCM i = scm_car (after);
       after = scm_cdr (after);
-      if (ly_c_equal_p (i, s))
+      if (ly_is_equal (i, s))
        break;
       before = scm_cons (i, before);
     }
@@ -686,7 +686,7 @@ alist_equal_p (SCM a, SCM b)
       SCM l = scm_assoc (key, b);
 
       if (l == SCM_BOOL_F
-         || !ly_c_equal_p (scm_cdr (l), val))
+         || !ly_is_equal (scm_cdr (l), val))
 
        return false;
     }
index 92bf4952c265902d89695fb477a0996f46cecf37..48e22c3465e9f841aae53ddbec649f7e4cb08777 100644 (file)
@@ -102,7 +102,7 @@ Mark_engraver::process_music ()
       SCM m = mark_ev_->get_property ("label");
       SCM proc = get_property ("markFormatter");
       if (!Text_interface::markup_p (m)
-         && ly_c_procedure_p (proc))
+         && ly_is_procedure (proc))
        {
          if (!scm_is_number (m))
            m = get_property ("rehearsalMark");
index b1b3bba0bb2246e33e3a22745f98f89dfcb9a087..b784131650e3d5e96391ee232892dfa0a0b91989 100644 (file)
@@ -43,7 +43,7 @@ LY_DEFINE (ly_make_music_function, "ly:make-music-function", 2, 0, 0,
        str += "music";
       else if (scm_car (s) == ly_lily_module_constant ("markup?"))
        str += "markup";
-      else if (ly_c_procedure_p (scm_car (s)))
+      else if (ly_is_procedure (scm_car (s)))
        str += "scm";
     }
   if (str == "") str = "noarg";
index bd7dcee4eb8da6105cc560993215401bf5b45aa2..14b084780ba88b6f134fea2b224f16b8c9fd6db9 100644 (file)
@@ -78,7 +78,7 @@ Music_iterator::get_static_get_iterator (Music *m)
 
   SCM ctor = m->get_property ("iterator-ctor");
   SCM iter = SCM_EOL;
-  if (ly_c_procedure_p (ctor))
+  if (ly_is_procedure (ctor))
     {
       iter = scm_call_0 (ctor);
       p = unsmob_iterator (iter);
index 304f658e4bf7ea96a4e25ba234364b2274ed4eb0..c34e970e74fa594e1f65ecdd526971e3473c143b 100644 (file)
@@ -100,7 +100,7 @@ Music::get_length () const
   if (unsmob_moment (lst))
     return *unsmob_moment (lst);
 
-  if (ly_c_procedure_p (length_callback_))
+  if (ly_is_procedure (length_callback_))
     {
       SCM res = scm_call_1 (length_callback_, self_scm ());
       return *unsmob_moment (res);
@@ -113,7 +113,7 @@ Moment
 Music::start_mom () const
 {
   SCM lst = start_callback_;
-  if (ly_c_procedure_p (lst))
+  if (ly_is_procedure (lst))
     {
       SCM res = scm_call_1 (lst, self_scm ());
       return *unsmob_moment (res);
@@ -195,7 +195,7 @@ Pitch
 Music::to_relative_octave (Pitch last)
 {
   SCM callback = get_property ("to-relative-callback");
-  if (ly_c_procedure_p (callback))
+  if (ly_is_procedure (callback))
     {
       Pitch *p = unsmob_pitch (scm_call_2 (callback, self_scm (), last.smobbed_copy ()));
       return *p;
index 333970b187aac2dce624d3043f88ef4f1dad1a6f..3be575f66128c9f06c29a6f04c9464774b7d5033 100644 (file)
@@ -71,7 +71,7 @@ check_meshing_chords (Grob *me,
   bool merge_possible = (ups[0] >= dps[0]) && (ups.top () >= dps.top ());
 
   /* Do not merge notes typeset in different style. */
-  if (!ly_c_equal_p (nu->get_property ("style"),
+  if (!ly_is_equal (nu->get_property ("style"),
                     nd->get_property ("style")))
     merge_possible = false;
 
index bfdc201fc28576660ca1e2afbc5739244f87a986..b3fb07b8fc88092f381ef1400debd42926403fe2 100644 (file)
@@ -42,7 +42,7 @@ internal_print (Grob *me, String *font_char)
   SCM proc = me->get_property ("glyph-name-procedure");
 
   String suffix =  to_string (robust_scm2int (me->get_property ("duration-log"), 2));
-  if (scm_procedure_p (proc) == SCM_BOOL_T)
+  if (ly_is_procedure (proc))
     suffix = ly_scm2string (scm_call_2 (proc, log, style));
   
   Font_metric *fm = Font_interface::get_default_font (me);
@@ -115,7 +115,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a)
     Fallback
   */
   SCM v = me->get_property ("stem-attachment-function");
-  if (!ly_c_procedure_p (v))
+  if (!ly_is_procedure (v))
     return 0.0;
 
   SCM result = scm_call_2 (v, me->self_scm (), scm_int2num (a));
index c80cc9c051cd6ad23e0d843300a36fef6d972247..2400383e61a46cd2e869279f66ca9dc110973b31 100644 (file)
@@ -44,7 +44,7 @@ Output_property_engraver::acknowledge_grob (Grob_info inf)
 
 
 
-      if (ly_c_procedure_p (pred))
+      if (ly_is_procedure (pred))
        {
          /*
            should typecheck pred. 
index cf1585bcd909b5cde59d717c824de0c405e0861e..97be3c094a3fc315df90a598979b959bd2748b45 100644 (file)
@@ -160,7 +160,7 @@ Paper_book::book_title ()
     scopes = scm_cons (header_, scopes);
 
   SCM tit = SCM_EOL;
-  if (ly_c_procedure_p (title_func))
+  if (ly_is_procedure (title_func))
     tit = scm_call_2 (title_func,
                      paper_->self_scm (),
                      scopes);
@@ -189,7 +189,7 @@ Paper_book::score_title (SCM header)
     scopes = scm_cons (header, scopes);
 
   SCM tit = SCM_EOL;
-  if (ly_c_procedure_p (title_func))
+  if (ly_is_procedure (title_func))
     tit = scm_call_2 (title_func,
                      paper_->self_scm (),
                      scopes);
index 2c8af7e906ac001a61822bf23b7709df82fd48a8..81d1fcd29a73c482414817e3d0ae7e29ca7e29ec 100644 (file)
 #include "warn.hh"
 #include "stencil.hh"
 
+
+
 LY_DEFINE (ly_make_paper_outputter, "ly:make-paper-outputter",
-          2, 0, 0, (SCM outname, SCM format),
+          2, 0, 0, (SCM port, SCM format),
           "Create an outputter that evaluates within "
-          "@code{output-}@var{format}, writing to file @var{outname}.")
+          "@code{output-}@var{format}, writing to  @var{port}.")
 {
-  SCM_ASSERT_TYPE (scm_is_string (outname), outname, SCM_ARG1, __FUNCTION__,
-                  "String");
+  SCM_ASSERT_TYPE (ly_is_port (port), port, SCM_ARG1, __FUNCTION__,
+                  "port");
   SCM_ASSERT_TYPE (scm_is_string (format), format, SCM_ARG2, __FUNCTION__,
                   "String");
 
-  String outname_str = ly_scm2string (outname);
   String f = ly_scm2string (format);
 
   message (_f ("Layout output to `%s'...",
-                          outname_str == "-"
-                          ? String ("<stdout>")
-                          : outname_str));
+              ly_scm2string (scm_port_filename (port)).to_str0 ()));
+
   progress_indication ("\n");
-  Paper_outputter *po = new Paper_outputter (outname_str, f);
+  Paper_outputter *po = new Paper_outputter (port, f);
 
   scm_gc_unprotect_object (po->self_scm ());
   return po->self_scm ();
index 778c15880ef980bab22f5a38088c399fa1b0e1d0..de9c16fc87d9fa5e8dd141cd5f2dcc4054cbd6b1 100644 (file)
 
 #include "ly-smobs.icc"
 
-Paper_outputter::Paper_outputter (String file_name, String format)
+Paper_outputter::Paper_outputter (SCM port, String format)
 {
-  file_ = SCM_EOL;
+  file_ = port;
   output_module_ = SCM_EOL;
   smobify_self ();
 
-  file_name_ = file_name;
   String module_name = "scm output-" + format;
   output_module_ = scm_c_resolve_module (module_name.to_str0 ());
 }
@@ -62,18 +61,8 @@ Paper_outputter::print_smob (SCM x, SCM p, scm_print_state*)
 }
 
 SCM
-Paper_outputter::file ()
+Paper_outputter::file () const
 {
-  if (file_ == SCM_EOL)
-    if (file_name_ == "-")
-      file_ = scm_current_output_port ();
-    else
-      /*
-       Opening binary sucks a little for DOS, since PS doesn't look like
-       ASCII anymore, but binary CFFs will get embedded correctly.
-       */
-      file_ = scm_open_file (scm_makfrom0str (file_name_.to_str0 ()),
-                            scm_makfrom0str ("wb"));
   return file_;
 }
 
index b12b03e79682db542cdbe03a4d75a2eebe96fbf1..78d54517a3682916b08ce276dc75a936fa040c69 100644 (file)
@@ -84,7 +84,7 @@ tag_music (Music *m, SCM tag, Input ip)
        SCM tags = m->get_property ("tags");
        if (scm_is_symbol (tag))
                tags = scm_cons (tag, tags);
-       else if (ly_c_list_p (tag))
+       else if (ly_is_list (tag))
                tags = ly_append2 (tag, tags);
        else
                ip.warning (_ ("tag must be symbol or list of symbols"));
@@ -171,8 +171,8 @@ make_chord (SCM pitch, SCM dur, SCM modification_list)
 bool
 ly_input_procedure_p (SCM x)
 {
-       return ly_c_procedure_p (x)
-               || (scm_is_pair (x) && ly_c_procedure_p (scm_car (x)));
+       return ly_is_procedure (x)
+               || (scm_is_pair (x) && ly_is_procedure (scm_car (x)));
 }
 
 Music*
@@ -999,7 +999,7 @@ Repeated_music:
                r->set_property ("repeat-count", scm_int2num (max (times, 1)));
 
                r-> set_property ("elements",alts);
-               if (ly_c_equal_p ($2, scm_makfrom0str ("tremolo"))) {
+               if (ly_is_equal ($2, scm_makfrom0str ("tremolo"))) {
                        /*
                        TODO: move this code to Scheme.
                        */
@@ -2756,7 +2756,7 @@ property_op_to_music (SCM op)
                bool itc = do_internal_type_checking_global;
                /* UGH.
                */
-               bool autobeam = ly_c_equal_p (symbol, ly_symbol2scm ("autoBeamSettings"));
+               bool autobeam = ly_is_equal (symbol, ly_symbol2scm ("autoBeamSettings"));
                if (autobeam)
                        do_internal_type_checking_global = false;
                m->set_property ("grob-property", grob_sym);
index 835d6b1f59375957af9f4b5e7fa35a88fd2c5b4d..c1c3bcb250e4440cafc07bc448a770f45afb6703 100644 (file)
@@ -154,7 +154,7 @@ Piano_pedal_engraver::try_music (Music *m)
       for (Pedal_info *p = info_list_; p->name_; p++)
        {
          String nm = p->name_ + String ("Event");
-         if (ly_c_equal_p (m->get_property ("name"),
+         if (ly_is_equal (m->get_property ("name"),
                            scm_str2symbol (nm.to_str0 ())))
            {
              Direction d = to_dir (m->get_property ("span-direction"));
index 8393fbe83d7079a1167f155b9a3b530552293444..242a181fcd5a24b77978e8b25e3ad90d54b9d992 100644 (file)
@@ -128,7 +128,7 @@ Piano_pedal_performer::try_music (Music *r)
       for (Pedal_info *p = info_alist_; p->name_; p++)
        {
          String nm = p->name_ + String ("Event");
-         if (ly_c_equal_p (r->get_property ("name"),
+         if (ly_is_equal (r->get_property ("name"),
                            scm_str2symbol (nm.to_str0 ())))
            {
              Direction d = to_dir (r->get_property ("span-direction"));
index 5b98ba672dff822ac075818d3842ea3e0cbb41f3..5cf6c7130410bb5e6106e962960f9b93db4d5bbe 100644 (file)
@@ -68,7 +68,7 @@ Recording_group_engraver::finalize ()
   Engraver_group_engraver::finalize ();
   SCM proc = get_property ("recordEventSequence");
 
-  if (ly_c_procedure_p (proc))
+  if (ly_is_procedure (proc))
     scm_call_2 (proc, context ()->self_scm (), scm_cdr (accumulator_));
 }
 
index 376a89b0ab4c94f67c99e2addc4c9a17e80b4901..77b840d597ac1cdbfc9da837840902cda6df8d07 100644 (file)
@@ -96,7 +96,7 @@ Repeat_acknowledge_engraver::process_music ()
   */
   SCM wb = get_property ("whichBar");
   SCM db = get_property ("defaultBarType");
-  if (!scm_is_string (wb) || ly_c_equal_p (db, wb))
+  if (!scm_is_string (wb) || ly_is_equal (db, wb))
     {
       if (s != "" || (volta_found && !scm_is_string (wb)))
        {
index bc001d68a7665e95842e520534a74e62735ef5ee..42a766b33945d66e4cab80b860861eb2da091481 100644 (file)
@@ -60,7 +60,7 @@ Script_engraver::try_music (Music *m)
       /* Discard double articulations for part-combining.  */
       int script_count = scripts_.size ();
       for (int i = 0; i < script_count; i++)
-       if (ly_c_equal_p (scripts_[i].event_
+       if (ly_is_equal (scripts_[i].event_
                          ->get_property ("articulation-type"),
                          m->get_property ("articulation-type")))
          return true;
@@ -116,7 +116,7 @@ void make_script_from_event (Grob *p, bool *follow, Context *tg,
     {
       SCM sym = scm_caar (s);
       SCM type = scm_object_property (sym, ly_symbol2scm ("backend-type?"));
-      if (!ly_c_procedure_p (type))
+      if (!ly_is_procedure (type))
        continue;
 
       SCM val = scm_cdar (s);
index 7239ba928977ea734297d09558087499b726fa57..84a1beaf493317c732571899554a9d9574f02608 100644 (file)
@@ -824,7 +824,7 @@ Slur_score_state::get_extra_encompass_infos () const
              if (to_boolean (g->get_property ("cautionary")))
                {
                  SCM cstyle = g->get_property ("cautionary-style");
-                 parens = ly_c_equal_p (cstyle, ly_symbol2scm ("parentheses"));
+                 parens = ly_is_equal (cstyle, ly_symbol2scm ("parentheses"));
                }
 
              SCM accs = g->get_property ("accidentals");
index a3d1fc4887b4cee567150b5d9410c97dbb0dabd7..80339b3ce8f6ff493fd4d6df62ffa7e319ca47b3 100644 (file)
@@ -64,7 +64,7 @@ Span_bar_engraver::stop_translation_timestep ()
 
       SCM vissym = ly_symbol2scm ("break-visibility");
       SCM vis = bars_[0]->internal_get_property (vissym);
-      if (ly_c_equal_p (spanbar_->internal_get_property (vissym), vis))
+      if (ly_is_equal (spanbar_->internal_get_property (vissym), vis))
        spanbar_->internal_set_property (vissym, vis);
 
       spanbar_ = 0;
index b497f3f9af544a7d47a6d8dbc2ceb00f456944cb..4b40e88659510cd3d983e7cae3e46dbbe0a7224c 100644 (file)
@@ -293,7 +293,7 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression",
           4, 0, 0, (SCM expr, SCM func, SCM arg1, SCM offset),
           "Parse EXPR, feed bits to FUNC with first arg ARG1")
 {
-  SCM_ASSERT_TYPE (ly_c_procedure_p (func), func, SCM_ARG1, __FUNCTION__,
+  SCM_ASSERT_TYPE (ly_is_procedure (func), func, SCM_ARG1, __FUNCTION__,
                   "procedure");
 
   Stencil_interpret_arguments a;
index bf6daa8b9e8ea4e45e2ff65cedbae4a7ed88a497..389c355a1ae89816b50e1c8b90da5bfd77450808 100644 (file)
@@ -45,11 +45,11 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf)
       /*
        UGH UGH
       */
-      if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str ("brace"))
-         && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
+      if (scm_is_string (gl) && ly_is_equal (gl, scm_makfrom0str ("brace"))
+         && scm_is_string (my_gl) && ly_is_equal (my_gl, scm_makfrom0str ("bracket")))
        inf.grob ()->translate_axis (-0.8, X_AXIS); // ugh
-      else if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str ("bracket"))
-              && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket")))
+      else if (scm_is_string (gl) && ly_is_equal (gl, scm_makfrom0str ("bracket"))
+              && scm_is_string (my_gl) && ly_is_equal (my_gl, scm_makfrom0str ("bracket")))
        {
          inf.grob ()->translate_axis (-0.8, X_AXIS); // ugh
        }
index 9192c7acf358f46d0980c5bd907ffe91a9a66e5e..8e978a4bc5a43e06bf4dfe8fdf4d20fef0bb1c24 100644 (file)
@@ -65,7 +65,7 @@ System_start_delimiter::after_line_breaking (SCM smob)
   Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (smob));
   
   SCM gl = me->get_property ("glyph");
-  if (ly_c_equal_p (gl, scm_makfrom0str ("bar-line")))
+  if (ly_is_equal (gl, scm_makfrom0str ("bar-line")))
     {
       int count = 0;
       Paper_column *left_column = me->get_bound (LEFT)->get_column ();  
index cf011b16cea906fd0d3e3cde8a6c48c5719805b0..2a88a4ae3c8968a2d532aa4cac33e2d908ddeeaf 100644 (file)
@@ -243,7 +243,7 @@ System::pre_processing ()
     {
       Grob *e = unsmob_grob (scm_car (s));
       SCM proc = e->get_property ("spacing-procedure");
-      if (ly_c_procedure_p (proc))
+      if (ly_is_procedure (proc))
        scm_call_1 (proc, e->self_scm ());
     }
 }
index 2e9ce6c1969920f79a726b4982ab011e3ab45182..0705690f171645ccca8eb6db9cb29ac9f1b951de 100644 (file)
@@ -115,7 +115,7 @@ Tie_engraver::acknowledge_grob (Grob_info i)
            maybe should check positions too.
          */
          if (right_mus && left_mus
-             && ly_c_equal_p (right_mus->get_property ("pitch"),
+             && ly_is_equal (right_mus->get_property ("pitch"),
                               left_mus->get_property ("pitch")))
            {
              Grob *p = new Spanner (heads_to_tie_[i].tie_definition_,
index f415317ae7fee72df7843ac3198ed67285613f54..652046e0a66f37c53fa4b1602187ac0858edf0c3 100644 (file)
@@ -69,7 +69,7 @@ Tie_performer::acknowledge_audio_element (Audio_element_info inf)
          Music *left_mus = heads_to_tie_[i].event_;
 
          if (right_mus && left_mus
-             && ly_c_equal_p (right_mus->get_property ("pitch"),
+             && ly_is_equal (right_mus->get_property ("pitch"),
                               left_mus->get_property ("pitch")))
            {
              an->tie_to (th);
index 397b3cf653be7444b5e30347c2b53139d6c66e91..072990db3f48989beaed0b5496ae94e1860b32dd 100644 (file)
@@ -47,7 +47,7 @@ void
 Time_signature_performer::create_audio_elements ()
 {
   SCM fr = get_property ("timeSignatureFraction");
-  if (scm_is_pair (fr) && !ly_c_equal_p (fr, prev_fraction_))
+  if (scm_is_pair (fr) && !ly_is_equal (fr, prev_fraction_))
     {
       prev_fraction_ = fr;
       int b = scm_to_int (scm_car (fr));
index bf82dc093103b9b581e718d837dc7c98d527d5d5..2b1df50fa280a04300c64bd37f766e65cda1d39b 100644 (file)
@@ -76,7 +76,7 @@ Tuplet_engraver::process_music ()
       tuplets_[i].spanner_ = spanner;
 
       SCM proc = get_property ("tupletNumberFormatFunction");
-      if (ly_c_procedure_p (proc))
+      if (ly_is_procedure (proc))
        {
          SCM t = scm_apply_0 (proc, scm_list_1 (tuplets_[i].music_->self_scm ()));
          spanner->set_property ("text", t);
index 694f4e4451d765f704c3def7f49779185b375531..7770d9b13cbea451bffd1f54a8d1779099a21e13 100644 (file)
@@ -26,7 +26,7 @@ LY_DEFINE (ly_grob_insert_tweak, "ly:grob-insert-tweak",
   Grob *gr = unsmob_grob (grob);
   SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "Grob");
   SCM_ASSERT_TYPE (scm_list_p (tweak) == SCM_BOOL_T
-                  && ly_c_procedure_p (scm_car (tweak)),
+                  && ly_is_procedure (scm_car (tweak)),
                   tweak, SCM_ARG2, __FUNCTION__, "Tweak");
 
   global_registry_->insert_grob_tweak (gr, tweak);
@@ -41,7 +41,7 @@ LY_DEFINE (ly_grob_replace_tweak, "ly:grob-replace-tweak",
   Grob *gr = unsmob_grob (grob);
   SCM_ASSERT_TYPE (gr, grob, SCM_ARG1, __FUNCTION__, "Grob");
   SCM_ASSERT_TYPE (scm_list_p (tweak) == SCM_BOOL_T
-                  && ly_c_procedure_p (scm_car (tweak)),
+                  && ly_is_procedure (scm_car (tweak)),
                   tweak, SCM_ARG2, __FUNCTION__, "Tweak");
 
   global_registry_->replace_grob_tweak (gr, tweak);
index 0dad2a827b485cd28dd64965d0ea45eaaabcd849..27f0b65df323114ea84180ba9a5df20266510ad6 100644 (file)
 
 (define-public (output-framework basename book scopes fields)
   (let* ((filename (format "~a.ps" basename))
-        (outputter (ly:make-paper-outputter filename "ps"))
+        (outputter (ly:make-paper-outputter
+                    (open-file filename "wb")
+                    "ps"))
         (paper (ly:paper-book-paper book))
         (pages (ly:paper-book-pages book))
         (landscape? (eq? (ly:output-def-lookup paper 'landscape) #t))
          (max (1+ (car box)) (caddr box))
          (max (1+ (cadr box)) (cadddr box)))))
 
-  (let* ((outputter (ly:make-paper-outputter (format "~a.eps" filename) "ps"))
+  (let* ((outputter (ly:make-paper-outputter
+
+                    ;; need to have binary for embedding CFFs
+                    (open-file (format "~a.eps" filename) "wb")
+                    "ps"))
         (port (ly:outputter-port outputter))
         (xext (ly:stencil-extent dump-me X))
         (yext (ly:stencil-extent dump-me Y))
index 192b7960c25985284823c3dab32ac00745d6fd82..9efd4f8328d2907118883bf8c3358d14b6a29d8f 100644 (file)
@@ -18,7 +18,7 @@
 
 (define-public (output-framework basename book scopes fields)
   (let* ((filename (format "~a.svg" basename))
-        (outputter  (ly:make-paper-outputter filename
+        (outputter  (ly:make-paper-outputter (open-file filename "wb")
                                              (ly:output-backend)))
         (dump (lambda (str) (display str (ly:outputter-port outputter))))
         (paper (ly:paper-book-paper book))
index 441fcd557d92d4f0169ef99b036ba377514568ae..a6b28b1d23f9bca887c56fc464f498df8c7e674a 100644 (file)
 
 (define-public (output-framework basename book scopes fields)
   (let* ((filename (format "~a.tex" basename))
-        (outputter  (ly:make-paper-outputter filename "tex"))
+        (outputter  (ly:make-paper-outputter (open-file filename "wb") "tex"))
         (paper (ly:paper-book-paper book))
         (pages (ly:paper-book-pages book))
         (last-page (car (last-pair pages)))
 (define-public (output-classic-framework
                basename book scopes fields)
   (let* ((filename (format "~a.tex" basename))
-        (outputter  (ly:make-paper-outputter filename "tex"))
+        (outputter  (ly:make-paper-outputter
+                     (open-file filename "w") "tex"))
         (paper (ly:paper-book-paper book))
         (lines (ly:paper-book-systems book))
         (last-line (car (last-pair lines))))
 (define-public (output-preview-framework
                basename book scopes fields)
   (let* ((filename (format "~a.tex" basename))
-        (outputter  (ly:make-paper-outputter filename
+        (outputter  (ly:make-paper-outputter (open-file filename "wb")
                                              "tex"))
         (paper (ly:paper-book-paper book))
         (lines (ly:paper-book-systems book))
index df677004e8b8662babbeaa8a98f48209f0e286d3..7fd5294b4987ba7a8da3f85dca178a21d2c32e75 100644 (file)
@@ -32,7 +32,9 @@
 
 (define-public (output-classic-framework basename book scopes fields)
   (let* ((filename (format "~a.texstr" basename))
-        (outputter (ly:make-paper-outputter filename (ly:output-backend)))
+        (outputter (ly:make-paper-outputter
+                    (open-file filename "wb")
+                    (ly:output-backend)))
         (paper (ly:paper-book-paper book))
         (lines (ly:paper-book-systems book)))
     (ly:outputter-dump-string outputter (header basename))
 
 (define-public (output-framework basename book scopes fields )
   (let* ((filename (format "~a.texstr" basename))
-        (outputter (ly:make-paper-outputter filename (ly:output-backend)))
+        (outputter
+         (ly:make-paper-outputter
+          (open-file filename "wb")
+          (ly:output-backend)))
         (paper (ly:paper-book-paper book))
         (pages (ly:paper-book-pages book)))
     (ly:outputter-dump-string outputter (header basename))