]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
Merge branch 'jneeman' of git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond into jneeman
[lilypond.git] / lily / lily-guile.cc
index e932f342b731a2f2bd5fbdf4ddab27e5ec0ac18d..d57a9f5730e7e936fdd7b2307aa49dc9359e20ea 100644 (file)
@@ -16,8 +16,6 @@
 
 using namespace std;
 
-#include "config.hh"
-
 #include "dimensions.hh"
 #include "direction.hh"
 #include "file-path.hh"
@@ -114,12 +112,15 @@ gulp_file_to_string (string fn, bool must_exist, int size)
   return result;
 }
 
-void
-ly_display_scm (void *s)
-{
-  scm_display ((SCM)s, scm_current_output_port ());
-  scm_newline (scm_current_output_port ());
-}
+extern "C" {
+  // maybe gdb 5.0 becomes quicker if it doesn't do fancy C++ typing?
+  void
+  ly_display_scm (SCM s)
+  {
+    scm_display (s, scm_current_output_port ());
+    scm_newline (scm_current_output_port ());
+  }
+};
 
 string
 ly_scm2string (SCM str)
@@ -302,6 +303,28 @@ ly_scm2offset (SCM s)
                 scm_to_double (scm_cdr (s)));
 }
 
+SCM
+ly_offsets2scm (vector<Offset> os)
+{
+  SCM l = SCM_EOL;
+  SCM *tail = &l;
+  for (vsize i = 0; i < os.size (); i++)
+    {
+      *tail = scm_cons (ly_offset2scm (os[i]), SCM_EOL);
+      tail = SCM_CDRLOC(*tail);
+    }
+  return l;
+}
+
+vector<Offset>
+ly_scm2offsets (SCM s)
+{
+  vector<Offset> os;
+  for (; scm_is_pair (s); s = scm_cdr (s))
+    os.push_back (ly_scm2offset (scm_car (s)));
+  return os;
+}
+
 SCM
 ly_deep_copy (SCM src)
 {