]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/function-documentation.cc
* The grand 2005-2006 replace.
[lilypond.git] / lily / function-documentation.cc
index b65461d81a7da5a0cada1c1f8305f8ddf9c0b10a..d1eacb357dceffe6e88bf7530d846f254fa6bae2 100644 (file)
@@ -1,32 +1,32 @@
-/*   
-  function-documentation.cc -- 
+/*
+  function-documentation.cc -- Scheme doc strings.
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
-
+  (c) 2004--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include <cstring>
+using namespace std;
 
-#include "protected-scm.hh"
 #include "string.hh"
+#include "lily-guile.hh"
 
-static Protected_scm doc_hash_table ;
+static SCM doc_hash_table;
 
 void ly_add_function_documentation (SCM func,
-                                   char const * fname,
-                                   char const * varlist,
-                                   char const * doc)
+                                   char const *fname,
+                                   char const *varlist,
+                                   char const *doc)
 {
   if (!strlen (doc))
     return;
-    
-  if (!scm_is_vector (doc_hash_table))
-    doc_hash_table = scm_make_vector (scm_int2num (59), SCM_EOL);
+
+  if (!doc_hash_table)
+    doc_hash_table = scm_permanent_object (scm_c_make_hash_table (59));
 
   String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist
-    + "\n" + doc ;
+    + "\n" + doc;
 
   scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
                                scm_makfrom0str (s.to_str0 ()));
@@ -34,10 +34,9 @@ void ly_add_function_documentation (SCM func,
   scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
 }
 
-
 LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation",
-         0,0,0, (),
-         "Get a hash table with all lilypond Scheme extension functions.")
+          0, 0, 0, (),
+          "Get a hash table with all lilypond Scheme extension functions.")
 {
   return doc_hash_table;
 }