-bool lily_1_8_relative = false;
-bool lily_1_8_compatibility_used = false;
-bool profile_property_accesses = false;
-/*
- crash if internally the wrong type is used for a grob property.
-*/
-bool do_internal_type_checking_global;
-
-static SCM option_hash;
-
-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"))
- {
- profile_property_accesses = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
- else if (var == ly_symbol2scm ("midi-debug"))
- {
- do_midi_debugging_global = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
- else if (var == ly_symbol2scm ("point-and-click"))
- {
- point_and_click_global = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
- else if (var == ly_symbol2scm ("parse-protect"))
- {
- parse_protect_global = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
- else if (var == ly_symbol2scm ("internal-type-checking"))
- {
- do_internal_type_checking_global = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
- else if (var == ly_symbol2scm ("old-relative"))
- {
- lily_1_8_relative = to_boolean (val);
- /* Needs to be reset for each file that uses this option. */
- lily_1_8_compatibility_used = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
- else if (var == ly_symbol2scm ("object-keys"))
- {
- use_object_keys = to_boolean (val);
- val = scm_from_bool (to_boolean (val));
- }
-}
-
-const int HELP_INDENT = 30;
-const int INDENT = 2;
-const int SEPARATION = 5;
-
-/*
- Hmmm. should do in SCM / C++ ?
-*/
-static String
-get_help_string ()
-{
- SCM alist = ly_hash2alist (option_hash);
- SCM convertor = ly_lily_module_constant ("scm->string");
-
- Array<String> opts;
-
- for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
- {
- SCM sym = scm_caar (s);
- SCM val = scm_cdar (s);
- String opt_spec
- = String_convert::char_string (' ', INDENT)
- + ly_symbol2string (sym)
- + " ("
- + ly_scm2string (scm_call_1 (convertor, val))
- + ")";
-
- if (opt_spec.length () + SEPARATION > HELP_INDENT)
- {
- opt_spec += "\n"
- + String_convert::char_string (' ', HELP_INDENT);
- }
- else
- opt_spec += String_convert::char_string (' ', HELP_INDENT - opt_spec.length ());
-
- SCM opt_help_scm
- = scm_object_property (sym, ly_symbol2scm ("program-option-documentation"));
- String opt_help = ly_scm2string (opt_help_scm);
- opt_help.substitute (String ("\n"),
- String ("\n")
- + String_convert::char_string (' ', HELP_INDENT));