X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ffunction-documentation.cc;h=7e450528ae13e65813f26cbbd6baeba9fa61a6ef;hb=48ed0e44eb2e6108d615154961f3662c25b85d88;hp=8ea300dab31df46252e1f0d31aaaaabcf3d96163;hpb=d5ee1e891224315cf62ddcd272d5ff57a28a2355;p=lilypond.git diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 8ea300dab3..7e450528ae 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -3,15 +3,16 @@ source file of the GNU LilyPond music typesetter - (c) 2004--2005 Han-Wen Nienhuys + (c) 2004--2007 Han-Wen Nienhuys */ #include +using namespace std; -#include "protected-scm.hh" -#include "string.hh" +#include "std-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, @@ -21,15 +22,15 @@ void ly_add_function_documentation (SCM func, if (!strlen (doc)) return; - if (scm_hash_table_p (doc_hash_table) == SCM_BOOL_T) - doc_hash_table = scm_c_make_hash_table (59); + if (!doc_hash_table) + doc_hash_table = scm_permanent_object (scm_c_make_hash_table (59)); - String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist + string s = string (" - ") + "LilyPond procedure: " + fname + " " + varlist + "\n" + doc; scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"), - scm_makfrom0str (s.to_str0 ())); - SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc)); + ly_string2scm (s)); + SCM entry = scm_cons (scm_from_locale_string (varlist), scm_from_locale_string (doc)); scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry); }