source file of the GNU LilyPond music typesetter
- (c) 2001--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ (c) 2001--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
#include "program-option.hh"
#include "warn.hh"
bool debug_skylines;
+bool debug_property_callbacks;
+bool debug_page_breaking_scoring;
+
+bool relative_includes;
/*
Backwards compatibility.
void internal_set_option (SCM var, SCM val)
{
- scm_hashq_set_x (option_hash, var, val);
-
if (0)
;
else if (var == ly_symbol2scm ("profile-property-accesses"))
debug_skylines = to_boolean (val);
val = scm_from_bool (to_boolean (val));
}
-}
-
+ else if (var == ly_symbol2scm ("debug-property-callbacks"))
+ {
+ debug_property_callbacks = to_boolean (val);
+ val = scm_from_bool (to_boolean (val));
+ }
+ else if (var == ly_symbol2scm ("debug-page-breaking-scoring"))
+ {
+ debug_page_breaking_scoring = to_boolean (val);
+ val = scm_from_bool (to_boolean (val));
+ }
+ else if (var == ly_symbol2scm ("datadir"))
+ {
+ /* ignore input value. */
+ val = ly_string2scm (lilypond_datadir);
+ }
+ else if (var == ly_symbol2scm ("relative-includes"))
+ {
+ relative_includes = to_boolean (val);
+ val = scm_from_bool (to_boolean (val));
+ }
+ scm_hashq_set_x (option_hash, var, val);
-bool
-get_program_option (const char *s)
-{
- SCM sym = ly_symbol2scm (s);
- return to_boolean (ly_get_option (sym));
}
+
ssize const HELP_INDENT = 30;
ssize const INDENT = 2;
ssize const SEPARATION = 5;
SCM opt_help_scm
= scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
string opt_help = ly_scm2string (opt_help_scm);
- replace_all (opt_help,
+ replace_all (&opt_help,
string ("\n"),
string ("\n")
+ String_convert::char_string (' ', HELP_INDENT));
LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (),
- "Print @code{ly:set-option} usage")
+ "Print @code{ly:set-option} usage.")
{
string help = get_help_string ();
progress_indication (help);
{
option_hash = scm_permanent_object (scm_c_make_hash_table (11));
}
- LY_ASSERT_FIRST_TYPE (ly_is_symbol, sym);
- LY_ASSERT_TYPE (scm_is_string, 3);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 1);
+ LY_ASSERT_TYPE (scm_is_string, description, 3);
internal_set_option (sym, val);
LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
"Set a program option.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_symbol, var);
+ LY_ASSERT_TYPE (ly_is_symbol, var, 1);
if (val == SCM_UNDEFINED)
val = SCM_BOOL_T;
}
LY_DEFINE (ly_command_line_options, "ly:command-line-options", 0, 0, 0, (),
- "The Scheme specified on command-line with @samp{-d}.")
+ "The Scheme options specified on command-line with @option{-d}.")
{
return ly_string2scm (init_scheme_variables_global);
}
LY_DEFINE (ly_command_line_code, "ly:command-line-code", 0, 0, 0, (),
- "The Scheme specified on command-line with @samp{-e}.")
+ "The Scheme code specified on command-line with @option{-e}.")
{
return ly_string2scm (init_scheme_code_global);
}
LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (),
- "Was be_verbose_global set?")
+ "Was @code{be_verbose_global} set?")
{
return scm_from_bool (be_verbose_global);
}
LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
"Get a global option setting.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_symbol, var);
+ LY_ASSERT_TYPE (ly_is_symbol, var, 1);
return scm_hashq_ref (option_hash, var, SCM_BOOL_F);
}
+
+