X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Ffunction-documentation.cc;h=f190f0e2b8eb1bf0b08c9901b1ef152ec33216f8;hb=58ff15e68c0d00ee54ca9f5565d6bc3c8304c076;hp=6c6e2eb7b667b2926e28322101d23dad269bc613;hpb=ae9943e466d3b718bc96a858438f43cd23d62fec;p=lilypond.git diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 6c6e2eb7b6..f190f0e2b8 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -1,9 +1,20 @@ /* - function-documentation.cc -- Scheme doc strings. + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2004--2010 Han-Wen Nienhuys - (c) 2004--2007 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include @@ -13,10 +24,6 @@ using namespace std; #include "lily-guile.hh" #include "warn.hh" -/* type predicates. */ -#include "spanner.hh" -#include "item.hh" - static SCM doc_hash_table; @@ -54,7 +61,7 @@ ly_add_function_documentation (SCM func, 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.") + "Get a hash table with all LilyPond Scheme extension functions.") { return doc_hash_table; } @@ -62,7 +69,7 @@ LY_DEFINE (ly_get_all_function_documentation, "ly:get-all-function-documentation #include -map type_names; +map type_names; void ly_add_type_predicate (void *ptr, @@ -83,33 +90,46 @@ predicate_to_typename (void *ptr) return type_names[ptr]; } -static int -arg_dir (int a, int b) -{ - if (&a < &b) - return 1; - else - return -1; -} - +/* type predicates. */ +#include "global-context.hh" +#include "input.hh" +#include "item.hh" +#include "music.hh" +#include "music-function.hh" +#include "paper-score.hh" +#include "performance.hh" +#include "spanner.hh" +#include "stream-event.hh" -int function_argument_direction; void init_func_doc () { - function_argument_direction = arg_dir (2,3); + ly_add_type_predicate ((void*) &is_direction, "direction"); + ly_add_type_predicate ((void*) &is_music_function, "Music_function"); + ly_add_type_predicate ((void*) &ly_is_port, "port"); + ly_add_type_predicate ((void*) &ly_cheap_is_list, "list"); + ly_add_type_predicate ((void*) &unsmob_global_context, "Global_context"); + ly_add_type_predicate ((void*) &unsmob_input, "Input"); + ly_add_type_predicate ((void*) &unsmob_moment, "Moment"); + ly_add_type_predicate ((void*) &unsmob_paper_score, "Paper_score"); + ly_add_type_predicate ((void*) &unsmob_performance, "Performance"); - ly_add_type_predicate ((void*) &scm_is_integer, "integer"); - ly_add_type_predicate ((void*) &scm_is_bool, "boolean"); - ly_add_type_predicate ((void*) &scm_is_pair, "pair"); + ly_add_type_predicate ((void*) &is_axis, "axis"); ly_add_type_predicate ((void*) &is_number_pair, "number pair"); + ly_add_type_predicate ((void*) &ly_is_list, "list"); + ly_add_type_predicate ((void*) &ly_is_procedure, "procedure"); + ly_add_type_predicate ((void*) &ly_is_symbol, "symbol"); + ly_add_type_predicate ((void*) &scm_is_bool, "boolean"); + ly_add_type_predicate ((void*) &scm_is_integer, "integer"); ly_add_type_predicate ((void*) &scm_is_number, "number"); + ly_add_type_predicate ((void*) &scm_is_pair, "pair"); + ly_add_type_predicate ((void*) &scm_is_rational, "rational"); ly_add_type_predicate ((void*) &scm_is_string, "string"); - ly_add_type_predicate ((void*) &ly_is_symbol, "symbol"); ly_add_type_predicate ((void*) &scm_is_vector, "vector"); - ly_add_type_predicate ((void*) &is_axis, "axis"); - ly_add_type_predicate ((void*) &unsmob_spanner, "spanner"); - ly_add_type_predicate ((void*) &unsmob_item, "item"); + ly_add_type_predicate ((void*) &unsmob_item, "Item"); + ly_add_type_predicate ((void*) &unsmob_music, "Music"); + ly_add_type_predicate ((void*) &unsmob_spanner, "Spanner"); + ly_add_type_predicate ((void*) &unsmob_stream_event, "Stream_event"); } ADD_SCM_INIT_FUNC (func_doc, init_func_doc);