]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
(determine-split-list): analysis has
[lilypond.git] / lily / lily-guile.cc
index a91937a2ff152f4664cf7c84755dec99315780ec..a7c8b58919ee7badfc53bd63077f245120943569 100644 (file)
@@ -13,7 +13,7 @@
 #include <stdlib.h>
 #include <math.h>   /* isinf */
 #include <string.h> /* strdup, strchr */
-
+#include <ctype.h>
 
 #include "lily-proto.hh"
 
@@ -699,8 +699,6 @@ int_list_to_slice (SCM l)
 }
 
 
-
-
 /*
   Return I-th element, or last elt L. If I < 0, then we take the first
   element.
@@ -716,3 +714,50 @@ robust_list_ref(int i, SCM l)
   return gh_car(l);
 }
 
+
+
+Real
+robust_scm2double (SCM k, double x)
+{
+  if (gh_number_p (k))
+    x = gh_scm2double (k);
+  return x;
+}
+
+Interval
+robust_scm2interval (SCM k, Drul_array<Real> v)
+{
+  Interval i;
+  i[LEFT]= v[LEFT];
+  i[RIGHT]= v[RIGHT];
+  if (is_number_pair (k))
+    i = ly_scm2interval (k);
+  return i;
+}
+
+Drul_array<Real>
+robust_scm2drul (SCM k, Drul_array<Real> v)
+{
+  if (is_number_pair (k))
+    v = ly_scm2interval (k);
+  return v;
+}
+
+Offset
+robust_scm2offset (SCM k, Offset o)
+{
+  if (is_number_pair (k))
+    o = ly_scm2offset (k);
+
+  return o;
+}
+
+
+int
+robust_scm2int (SCM k, int o)
+{
+  if (scm_integer_p (k) == SCM_BOOL_T)
+    o = gh_scm2int (k);
+
+  return o;
+}