]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/global-context-scheme.cc
Run `make grand-replace'.
[lilypond.git] / lily / global-context-scheme.cc
index c5f4d561f9966487c647527f8d189809ef0a8d6b..2281d268530c74bbd5ed1ff6f263725ce4805770 100644 (file)
@@ -3,8 +3,9 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  (c) 2005--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
+
 #include "cpu-timer.hh"
 #include "global-context.hh"
 #include "international.hh"
 
 LY_DEFINE (ly_format_output, "ly:format-output",
           1, 0, 0, (SCM context),
-          "Given a Global context in its final state, "
-          "process it and return the @code{Music_output} object in its final state.")
+          "Given a global context in its final state,"
+          " process it and return the @code{Music_output} object"
+          " in its final state.")
 {
   Global_context *g = dynamic_cast<Global_context *> (unsmob_context (context));
-  SCM_ASSERT_TYPE (g, context, SCM_ARG1, __FUNCTION__, "Global context");
+  
+  LY_ASSERT_TYPE (unsmob_global_context, context, 1)
 
   SCM output = g->get_output ();
   progress_indication ("\n");
@@ -35,11 +38,11 @@ LY_DEFINE (ly_format_output, "ly:format-output",
 
 LY_DEFINE (ly_make_global_translator, "ly:make-global-translator",
           1, 0, 0, (SCM global),
-          "Create a translator group and connect it to the global context\n"
-          "@var{global}. The translator group is returned.")
+          "Create a translator group and connect it to the global context"
+          " @var{global}.  The translator group is returned.")
 {
   Global_context *g = dynamic_cast<Global_context *> (unsmob_context (global));
-  SCM_ASSERT_TYPE (g, global, SCM_ARG1, __FUNCTION__, "Global context");
+  LY_ASSERT_TYPE (unsmob_global_context, global, 1)
 
   Translator_group *tg = new Translator_group ();
   tg->connect_to_context (g);
@@ -50,15 +53,11 @@ LY_DEFINE (ly_make_global_translator, "ly:make-global-translator",
 
 LY_DEFINE (ly_make_global_context, "ly:make-global-context",
           1, 0, 0, (SCM output_def),
-          "Set up a global interpretation context, using the output\n"
-          "block @var{output_def}.\n"
-          "The context is returned.\n"
-          )
+          "Set up a global interpretation context, using the output"
+          " block @var{output_def}.  The context is returned.")
 {
-  Output_def *odef = unsmob_output_def (output_def);
-
-  SCM_ASSERT_TYPE (odef, output_def, SCM_ARG1, __FUNCTION__,
-                  "Output definition");
+  LY_ASSERT_SMOB (Output_def, output_def, 1);
+  Output_def *odef = unsmob_output_def (output_def); 
 
   Global_context *glob = new Global_context (odef);
 
@@ -73,15 +72,13 @@ LY_DEFINE (ly_make_global_context, "ly:make-global-context",
 
 LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
           2, 0, 0, (SCM mus, SCM ctx),
-          "Interpret the music expression @var{mus} in the\n"
-          "global context @var{ctx}. The context is returned in its\n"
-          "final state.\n")
+          "Interpret the music expression @var{mus} in the global context"
+          " @var{ctx}.  The context is returned in its final state.")
 {
-  Music *music = unsmob_music (mus);
-  Global_context *g = dynamic_cast<Global_context *> (unsmob_context (ctx));
-  SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music");
-  SCM_ASSERT_TYPE (g, ctx, SCM_ARG2, __FUNCTION__, "Global context");
+  LY_ASSERT_SMOB (Music, mus, 1);
+  LY_ASSERT_TYPE (unsmob_global_context, ctx, 2);
 
+  Music *music = unsmob_music (mus);
   if (!music
       || !music->get_length ().to_bool ())
     {
@@ -89,6 +86,8 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
       return SCM_BOOL_F;
     }
 
+  Global_context *g = dynamic_cast<Global_context *> (unsmob_context (ctx));
+
   Cpu_timer timer;
 
   message (_ ("Interpreting music... "));
@@ -121,14 +120,17 @@ LY_DEFINE (ly_interpret_music_expression, "ly:interpret-music-expression",
 
 LY_DEFINE (ly_run_translator, "ly:run-translator",
           2, 1, 0, (SCM mus, SCM output_def),
-          "Process @var{mus} according to @var{output_def}. \n"
-          "An interpretation context is set up,\n"
-          "and @var{mus} is interpreted with it.  \n"
-          "The context is returned in its final state.\n"
-          "\n\n"
-          "Optionally, this routine takes an Object-key to\n"
-          "to uniquely identify the Score block containing it.\n")
+          "Process @var{mus} according to @var{output-def}.  An"
+          " interpretation context is set up, and @var{mus} is"
+          " interpreted with it.  The context is returned in its"
+          " final state.\n"
+          "\n"
+          "Optionally, this routine takes an object-key to"
+          " to uniquely identify the score block containing it.")
 {
+  LY_ASSERT_SMOB (Music, mus, 1);
+  LY_ASSERT_SMOB (Output_def, output_def, 2);
+
   SCM glob = ly_make_global_context (output_def);
   ly_make_global_translator (glob);
   ly_interpret_music_expression (mus, glob);