From 35f3d9edc664e13ebdcb5f46632101312dd9f2b3 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 3 Nov 2006 01:32:08 +0100 Subject: [PATCH] get_program_option() function --- lily/include/program-option.hh | 2 ++ lily/program-option.cc | 13 ++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) 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)); +} -- 2.39.5