]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
Merge with git+ssh://jneem@git.sv.gnu.org/srv/git/lilypond.git
[lilypond.git] / lily / lily-guile.cc
index f7938cfc210643a57993e34fbaf54e16fef3cc6a..e932f342b731a2f2bd5fbdf4ddab27e5ec0ac18d 100644 (file)
@@ -105,10 +105,8 @@ gulp_file_to_string (string fn, bool must_exist, int size)
   if (be_verbose_global)
     progress_indication ("[" + s);
 
-  int n = size;
-  char *str = gulp_file (s, &n);
-  string result (str, n);
-  delete[] str;
+  vector<char> chars = gulp_file (s, size);
+  string result (&chars[0], chars.size ());
 
   if (be_verbose_global)
     progress_indication ("]");
@@ -116,15 +114,12 @@ gulp_file_to_string (string fn, bool must_exist, int size)
   return result;
 }
 
-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 ());
-  }
-};
+void
+ly_display_scm (void *s)
+{
+  scm_display ((SCM)s, scm_current_output_port ());
+  scm_newline (scm_current_output_port ());
+}
 
 string
 ly_scm2string (SCM str)
@@ -655,6 +650,14 @@ robust_scm2offset (SCM k, Offset o)
   return o;
 }
 
+string
+robust_scm2string (SCM k, string s)
+{
+  if (scm_is_string (k))
+    s = ly_scm2string (k);
+  return s;
+}
+
 int
 robust_scm2int (SCM k, int o)
 {