]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/lily-guile-macros.hh
Make a pure version of calc_next_staff_spacing.
[lilypond.git] / lily / include / lily-guile-macros.hh
index aaa883ed15665e496f38900e9e06a6bd9345097a..b86c31715da0c88824b8801dbe431a08c0d3a10f 100644 (file)
@@ -1,9 +1,20 @@
 /*
-  lily-guile-macros.hh -- declare GUILE interaction macros.
+  This file is part of LilyPond, the GNU music typesetter.
 
-  source file of the GNU LilyPond music typesetter
+  Copyright (C) 2005--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-  (c) 2005--2007 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  LilyPond is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 3 of the License, or
+  (at your option) any later version.
+
+  LilyPond is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef LILY_GUILE_MACROS_HH
@@ -185,6 +196,10 @@ void ly_check_name (string cxx, string fname);
                          VAR, ARGLIST, DOCSTRING)
 
 #define get_property(x) internal_get_property (ly_symbol2scm (x))
+#define get_pure_property(x,y,z) \
+  internal_get_pure_property (ly_symbol2scm (x), y, z)
+#define get_maybe_pure_property(w,x,y,z) \
+  internal_get_maybe_pure_property (ly_symbol2scm (w), x, y, z)
 #define get_property_data(x) internal_get_property_data (ly_symbol2scm (x))
 #define get_object(x) internal_get_object (ly_symbol2scm (x))
 #define set_object(x, y) internal_set_object (ly_symbol2scm (x), y)
@@ -195,36 +210,25 @@ void ly_check_name (string cxx, string fname);
   TODO: include modification callback support here, perhaps
   through intermediate Grob::instrumented_set_property( .. __LINE__ ).
  */
-#define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)  
+#define set_property(x, y) instrumented_set_property (ly_symbol2scm (x), y, __FILE__, __LINE__, __FUNCTION__)
 #else
 #define set_property(x, y) internal_set_property (ly_symbol2scm (x), y)
 #endif
 
 
-extern int function_argument_direction;
-
-#define LY_FUNC_NOTE_FIRST_ARG(a)  \
-  SCM *first_arg_ptr = &a;
 
-#define LY_ASSERT_TYPE(pred, number) \
+#define LY_ASSERT_TYPE(pred, var, number)                                      \
   {                                                                    \
-    if (!pred (first_arg_ptr[(number-1)*function_argument_direction]))         \
+    if (!pred (var)) \
       {                                                                        \
        scm_wrong_type_arg_msg(mangle_cxx_identifier (__FUNCTION__).c_str(), \
-                              number, first_arg_ptr[(number-1)*function_argument_direction], \
+                              number, var, \
                               predicate_to_typename ((void*) &pred).c_str()); \
       }                                                                        \
   }
 
-#define LY_ASSERT_SMOB(klass, number) LY_ASSERT_TYPE(klass::unsmob, number)
-
-
-#define LY_ASSERT_FIRST_TYPE(pred, var)                                \
-  LY_FUNC_NOTE_FIRST_ARG(var);                                 \
-  LY_ASSERT_TYPE(pred, 1);
+#define LY_ASSERT_SMOB(klass, var, number) LY_ASSERT_TYPE(klass::unsmob, var, number)
 
-#define LY_ASSERT_FIRST_SMOB(klass, var)                        \
-  LY_ASSERT_FIRST_TYPE(klass::unsmob, var)
 
 
 #endif /* LILY_GUILE_MACROS_HH */