From: Han-Wen Nienhuys Date: Fri, 3 Nov 2006 00:32:08 +0000 (+0100) Subject: get_program_option() function X-Git-Tag: release/2.10.0-2~34^2~20 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=35f3d9edc664e13ebdcb5f46632101312dd9f2b3;p=lilypond.git get_program_option() function --- diff --git a/lily/include/program-option.hh b/lily/include/program-option.hh index 5833ee5c37..55971a1fa1 100644 --- a/lily/include/program-option.hh +++ b/lily/include/program-option.hh @@ -20,4 +20,6 @@ extern bool profile_property_accesses; SCM ly_get_option (SCM); SCM ly_set_option (SCM, SCM); +bool get_program_option (const char *); + #endif /* SCM_OPTION_HH */ diff --git a/lily/program-option.cc b/lily/program-option.cc index b12a246f31..be81de380b 100644 --- a/lily/program-option.cc +++ b/lily/program-option.cc @@ -34,7 +34,6 @@ bool profile_property_accesses = false; bool do_internal_type_checking_global; bool strict_infinity_checking = false; - static SCM option_hash; void internal_set_option (SCM var, SCM val) @@ -209,6 +208,9 @@ LY_DEFINE (ly_command_line_verbose_p, "ly:command-line-verbose?", 0, 0, 0, (), 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.") { @@ -216,3 +218,12 @@ LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var), SCM_ARG1, __FUNCTION__, "symbol"); return scm_hashq_ref (option_hash, var, SCM_BOOL_F); } + + +bool +get_program_option (const char *s) +{ + SCM sym = ly_symbol2scm (s); + + return to_boolean (ly_get_option (sym)); +}