]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/prob-scheme.cc
Run grand-replace (issue 3765)
[lilypond.git] / lily / prob-scheme.cc
index 717e32a945985358af74ee08f379b372e4363294..51bd53c48aa8b8629ee6e875180ab539b9686aa9 100644 (file)
@@ -1,16 +1,27 @@
 /*
-  paper-system-scheme.cc -- implement Prob bindings
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2005--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #include "prob.hh"
 
 LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
-          2, 1, 0, (SCM obj, SCM sym, SCM value),
-          "Set property @var{sym} of @var{obj} to @var{value}.")
+           2, 1, 0, (SCM obj, SCM sym, SCM value),
+           "Set property @var{sym} of @var{obj} to @var{value}.")
 {
   LY_ASSERT_SMOB (Prob, obj, 1);
   Prob *ps = unsmob_prob (obj);
@@ -24,43 +35,45 @@ LY_DEFINE (ly_prob_set_property_x, "ly:prob-set-property!",
   Hmm, this is not orthogonal.
 */
 LY_DEFINE (ly_prob_property_p, "ly:prob-property?",
-          2, 1, 0, (SCM obj, SCM sym),
-          "Is boolean prop @var{sym} set?")
+           2, 1, 0, (SCM obj, SCM sym),
+           "Is boolean prop @var{sym} of @var{sym} set?")
 {
   return scm_equal_p (SCM_BOOL_T, ly_prob_property (obj, sym, SCM_BOOL_F));
 }
 
 LY_DEFINE (ly_prob_property, "ly:prob-property",
-          2, 1, 0, (SCM obj, SCM sym, SCM dfault),
-          "Return the value for @var{sym}.")
+           2, 1, 0, (SCM prob, SCM sym, SCM val),
+           "Return the value for property @var{sym} of Prob object"
+           " @var{prob}.  If no value is found, return @var{val} or"
+           " @code{'()} if @var{val} is not specified.")
 {
-  LY_ASSERT_SMOB (Prob, obj, 1);
-  Prob *ps = unsmob_prob (obj);
+  LY_ASSERT_SMOB (Prob, prob, 1);
+  Prob *ps = unsmob_prob (prob);
   LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
 
-  if (dfault == SCM_UNDEFINED)
-    dfault = SCM_EOL;
+  if (val == SCM_UNDEFINED)
+    val = SCM_EOL;
 
   SCM retval = ps->internal_get_property (sym);
   if (retval == SCM_EOL)
-    return dfault;
+    return val;
   else
     return retval;
 }
 
 LY_DEFINE (ly_prob_type_p, "ly:prob-type?",
-          2, 0, 0,
-          (SCM obj, SCM type),
-          "Is @var{obj} the specified prob-type?")
+           2, 0, 0,
+           (SCM obj, SCM type),
+           "Is @var{obj} the specified prob-type?")
 {
-  Prob*prob = unsmob_prob (obj);
+  Prob *prob = unsmob_prob (obj);
   return scm_from_bool (prob && prob->type () == type);
 }
 
 LY_DEFINE (ly_make_prob, "ly:make-prob",
-          2, 0, 1,
-          (SCM type, SCM init, SCM rest),
-          "Create a @code{Prob} object.")
+           2, 0, 1,
+           (SCM type, SCM init, SCM rest),
+           "Create a @code{Prob} object.")
 {
   Prob *pr = new Prob (type, init);
 
@@ -72,15 +85,14 @@ LY_DEFINE (ly_make_prob, "ly:make-prob",
 
       pr->set_property (sym, val);
     }
-  
+
   return pr->unprotect ();
 }
 
-
 LY_DEFINE (ly_prob_mutable_properties, "ly:prob-mutable-properties",
-          1, 0, 0,
-          (SCM prob),
-          "Retrieve an alist of mutable properties.")
+           1, 0, 0,
+           (SCM prob),
+           "Retrieve an alist of mutable properties.")
 {
   LY_ASSERT_SMOB (Prob, prob, 1);
   Prob *ps = unsmob_prob (prob);
@@ -88,9 +100,9 @@ LY_DEFINE (ly_prob_mutable_properties, "ly:prob-mutable-properties",
 }
 
 LY_DEFINE (ly_prob_immutable_properties, "ly:prob-immutable-properties",
-          1, 0, 0,
-          (SCM prob),
-          "Retrieve an alist of mutable properties.")
+           1, 0, 0,
+           (SCM prob),
+           "Retrieve an alist of immutable properties.")
 {
   LY_ASSERT_SMOB (Prob, prob, 1);
   Prob *ps = unsmob_prob (prob);