]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/lily-guile.cc
* Documentation/topdocs/NEWS.tely (Top): Mention markup text feature.
[lilypond.git] / lily / lily-guile.cc
index b39b56600731a801c82c62004fe20f509a035752..9cb3f082c46796151c2be80981da3774d1ca8b73 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
+  (c) 1998--2005 Jan Nieuwenhuizen <janneke@gnu.org>
                  Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
@@ -14,6 +14,7 @@
 #include <cctype>
 #include <libintl.h>           // gettext on macos x
 
+#include "config.hh"
 #include "version.hh"
 #include "lily-guile.hh"
 #include "libc-extension.hh"
@@ -96,7 +97,7 @@ gulp_file_to_string (String fn, bool must_exist)
       return s;
     }
 
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("[" + s);
 
   int n;
@@ -104,7 +105,7 @@ gulp_file_to_string (String fn, bool must_exist)
   String result ((Byte*) str, n);
   delete[] str;
   
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("]");
 
   return result;
@@ -185,14 +186,27 @@ void add_scm_init_func (void (*f) ())
   scm_init_funcs_->push (f);
 }
 
+#if KPATHSEA
+extern "C" {
+  void initialize_kpathsea ();
+}
+#endif
+    
 void
 ly_init_ly_module (void *)
 {
   for (int i = scm_init_funcs_->size () ; i--;)
     (scm_init_funcs_->elem (i)) ();
-
-  if (verbose_global_b)
+  if (be_verbose_global)
     progress_indication ("\n");
+
+#if KPATHSEA
+  if (is_TeX_format_global)
+    {
+      initialize_kpathsea ();
+    }
+#endif
   
   scm_primitive_load_path (scm_makfrom0str ("lily.scm"));
 }
@@ -303,9 +317,9 @@ ly_deep_copy (SCM src)
 {
   if (scm_is_pair (src))
     return scm_cons (ly_deep_copy (scm_car (src)), ly_deep_copy (scm_cdr (src)));
-  else if (ly_c_vector_p (src))
+  else if (scm_is_vector (src))
     {
-      int len = SCM_VECTOR_LENGTH (src);
+      int len = scm_c_vector_length (src);
       SCM nv = scm_c_make_vector (len, SCM_UNDEFINED);
       for (int i = 0 ;i < len ; i++)
        {
@@ -481,7 +495,7 @@ type_check_assignment (SCM sym, SCM val,  SCM type_symbol)
                 + "  " + _ ("Perhaps you made a typing error?"));
 
        /* Be strict when being anal :) */
-       if (internal_type_checking_global_b)
+       if (do_internal_type_checking_global)
          abort ();
        
        warning (_ ("Doing assignment anyway."));
@@ -703,3 +717,45 @@ alist_to_hashq (SCM alist)
     }
   return tab; 
 }
+
+
+bool
+alist_equal_p (SCM a, SCM b)
+{
+  for (SCM s = a;
+       scm_is_pair (s); s = scm_cdr (s))
+    {
+      SCM key = scm_caar (s);
+      SCM val = scm_cdar (s);
+      SCM l = scm_assoc (key, b);
+
+      if (l == SCM_BOOL_F
+         || !ly_c_equal_p ( scm_cdr (l), val))
+
+       return false;
+    }
+  return true;
+}
+
+
+
+SCM
+ly_alist_vals (SCM alist)
+{
+  SCM x = SCM_EOL;
+  for (SCM p = alist; scm_is_pair (p); p = scm_cdr (p))
+    {
+      x = scm_cons (scm_cdar (p), x);
+    }
+  return x;
+}
+
+SCM
+ly_hash2alist (SCM tab)
+{
+  SCM func = ly_lily_module_constant ("hash-table->alist");
+  return scm_call_1 (func, tab);
+}
+
+
+