X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Ffunction-documentation.cc;h=d1eacb357dceffe6e88bf7530d846f254fa6bae2;hb=75eebcb49e52d296b1da3e1074e0825d2c780db4;hp=b68f53c70bfa6799a31752f462cb838cbb90a6e2;hpb=947454c5cc430a9627262de4f25274a64789d3c2;p=lilypond.git diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index b68f53c70b..d1eacb357d 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -1,30 +1,42 @@ -#include "lily-guile.hh" -#include "protected-scm.hh" +/* + function-documentation.cc -- Scheme doc strings. + + source file of the GNU LilyPond music typesetter + + (c) 2004--2006 Han-Wen Nienhuys +*/ + +#include +using namespace std; + #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 (!gh_vector_p (doc_hash_table )) - doc_hash_table = scm_make_vector (gh_int2scm (59), SCM_EOL); + if (!strlen (doc)) + return; + + 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 ())); - SCM entry = gh_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc)); + 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; }