X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ffunction-documentation.cc;h=5081d7eb58592dc082eabe6af715e3d000225dbc;hb=70d5609d63efe8a9b42ff763b79348bf99953bf2;hp=579426b65a9cb2a93003e0eaa1b491b230babb4a;hpb=e24df7c27635dc996c466295eacf2981bddccaf7;p=lilypond.git diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 579426b65a..5081d7eb58 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -1,43 +1,42 @@ -/* - function-documentation.cc -- +/* + function-documentation.cc -- Scheme doc strings. source file of the GNU LilyPond music typesetter - (c) 2004--2005 Han-Wen Nienhuys - + (c) 2004--2006 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, - 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); - String s = String (" - ") + "LilyPond procedure: " + fname + " " + varlist - + "\n" + doc ; + 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; scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"), - scm_makfrom0str (s.to_str0 ())); + scm_makfrom0str (s.c_str ())); SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc)); 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; }