]> git.donarmstrong.com Git - lilypond.git/commitdiff
get_program_option() function
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 3 Nov 2006 00:32:08 +0000 (01:32 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 3 Nov 2006 00:32:08 +0000 (01:32 +0100)
lily/include/program-option.hh
lily/program-option.cc

index 5833ee5c37bea1c6f34082346c05d6d03c90c6fd..55971a1fa16ba6a74e451ad6e5ed81cc0bd36783 100644 (file)
@@ -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 */
index b12a246f311f8ae023d0a4b8aa31f0a82afe3877..be81de380bf49ec1d5fea180d445db17d7be7d49 100644 (file)
@@ -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));
+}