1 ;;;; This file is part of LilyPond, the GNU music typesetter.
3 ;;;; Copyright (C) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
6 ;;;; LilyPond is free software: you can redistribute it and/or modify
7 ;;;; it under the terms of the GNU General Public License as published by
8 ;;;; the Free Software Foundation, either version 3 of the License, or
9 ;;;; (at your option) any later version.
11 ;;;; LilyPond is distributed in the hope that it will be useful,
12 ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;;; GNU General Public License for more details.
16 ;;;; You should have received a copy of the GNU General Public License
17 ;;;; along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
22 (define (dashify-underscores str)
23 (regexp-substitute/global #f "_" str 'pre "-" 'post))
25 (define (format-c-header c-h)
26 (regexp-substitute/global
28 (regexp-substitute/global #f "(SCM|\\)|\\() *" (dashify-underscores c-h)
32 (define (document-scheme-function name c-header doc-string)
34 "@defun " (symbol->string name) " " (format-c-header c-header) "\n"
38 (define all-scheme-functions
40 (lambda (key val prior)
41 (cons (cons key val) prior))
42 '() (ly:get-all-function-documentation)))
44 (define (all-scheme-functions-doc)
45 (let* ((fdocs (map (lambda (x)
46 (document-scheme-function (car x) (cadr x) (cddr x)))
47 all-scheme-functions))
48 (sfdocs (sort fdocs ly:string-ci<?)))
50 #:name "Scheme functions"
51 #:desc "Primitive functions exported by LilyPond."
53 (apply string-append sfdocs))))
55 ;; (dump-node (all-scheme-functions-doc) (current-output-port) 0 )