]> git.donarmstrong.com Git - lilypond.git/blob - lily/scm-option.cc
patch::: 1.3.147.jcn1
[lilypond.git] / lily / scm-option.cc
1 /*   
2   scm-option.cc --  implement option setting from Scheme
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9
10 #include <iostream.h>
11 #include "string.hh"
12 #include "lily-guile.hh"
13 #include "scm-option.hh"
14
15 /*
16   TODO: mooie onschuldige test, en koel om allerleide dingen te kunnen zetten,
17   maar is dit nou wel handig voor gebruikert?
18
19   -X, of -fps is hendiger dan
20
21           -e "(set-lily-option 'midi-debug #t)'
22
23   [niet voor niets tiepo in 139 announs..]
24
25 */
26
27
28 /* Write midi as formatted ascii stream? */
29 bool midi_debug_global_b;
30 /* General purpose testing flag */
31 int testing_level_global;
32
33
34 /*
35
36   TODO: verzin iets tegen optie code bloot
37
38
39   other interesting stuff to add:
40
41 @item -T,--no-timestamps
42 don't timestamp the output
43
44 @item -t,--test
45 Switch on any experimental features.  Not for general public use.
46
47  */
48
49 SCM
50 set_lily_option (SCM var, SCM val)
51 {
52   if (var == ly_symbol2scm ("help"))
53     {
54       cout << '\n';
55       cout << _ ("Scheme options:");
56       cout << "help"; 
57       cout << "midi-debug (boolean)"; 
58       cout << "testing-level (int)"; 
59       cout << '\n';
60       exit (0);
61     }
62   else if (var == ly_symbol2scm ("midi-debug"))
63     {
64       midi_debug_global_b = to_boolean (val);
65     }
66   else if (var == ly_symbol2scm ("testing-level"))
67     {
68      testing_level_global = gh_scm2int (val); 
69     }
70   else if (var == ly_symbol2scm ("find-old-relative"))
71     {
72       /*
73         Seems to have been broken for some time!
74         
75         @item  -Q,--find-old-relative
76         show all changes needed to convert a file to  relative octave syntax.
77
78
79         
80       */
81
82       ;
83       
84     }
85
86   return SCM_UNSPECIFIED;
87 }
88
89
90 static void
91 init_functions ()
92 {
93   scm_make_gsubr ("set-lily-option", 2, 0, 0, (Scheme_function_unknown)set_lily_option);
94 }
95
96
97 ADD_SCM_INIT_FUNC (init_functions_sopt, init_functions);
98
99