* lexer-gcc-3.1.sh: Remove.
[lilypond/patrick.git] / lily / dimensions-scheme.cc
blob106eb05c23906253725003873c75d5e4ed27b304
1 /*
2 dimensions-scheme.cc -- implement Dimension handling
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7 */
9 #include "lily-guile.hh"
10 #include "dimensions.hh"
11 #include "warn.hh"
13 LY_DEFINE (ly_pt, "ly:pt",
14 1, 0, 0, (SCM num),
15 "@var{num} printer points")
17 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
18 "number");
19 return scm_from_double (point_constant
20 * scm_to_double (num));
23 LY_DEFINE (ly_cm, "ly:cm",
24 1, 0, 0, (SCM num),
25 "@var{num} cm")
27 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
28 "number");
29 return scm_from_double (cm_constant
30 * scm_to_double (num));
33 LY_DEFINE (ly_inch, "ly:inch",
34 1, 0, 0, (SCM num),
35 "@var{num} inches")
37 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
38 "number");
39 return scm_from_double (inch_constant
40 * scm_to_double (num));
43 LY_DEFINE (ly_mm, "ly:mm",
44 1, 0, 0, (SCM num),
45 "@var{num} mm")
47 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
48 "number");
49 return scm_from_double (mm_constant
50 * scm_to_double (num));
53 LY_DEFINE (ly_bp, "ly:bp",
54 1, 0, 0, (SCM num),
55 "@var{num} bigpoints (1/72th inch)")
57 SCM_ASSERT_TYPE (scm_is_number (num), num, SCM_ARG1, __FUNCTION__,
58 "number");
59 return scm_from_double (bigpoint_constant
60 * scm_to_double (num));