@lilypond[relative=1,verbatim,fragment]
<< \context Voice = melody {
+ \time 3/4
c2 e4 g2.
}
\new Lyrics \lyrics {
return ly_symbol2scm (tr->context_name ().to_str0 ());
}
-LY_DEFINE (is_contextushpop_property, "ly:context-pushpop-property",
+LY_DEFINE (ly_context_pushpop_property, "ly:context-pushpop-property",
3, 1, 0, (SCM context, SCM grob, SCM eltprop, SCM val),
"Do a single @code{\\override} or @code{\\revert} operation "
"in @var{context}. The grob definition @code{grob} is extended "
return SCM_UNDEFINED;
}
-LY_DEFINE (is_contextroperty, "ly:context-property",
+LY_DEFINE (ly_context_property, "ly:context-property",
2, 0, 0, (SCM c, SCM name),
"Return the value of @var{name} from context @var{c}")
{
return SCM_UNSPECIFIED;
}
-LY_DEFINE (is_contextroperty_where_defined, "ly:context-property-where-defined",
+LY_DEFINE (ly_context_property_where_defined, "ly:context-property-where-defined",
2, 0, 0, (SCM context, SCM name),
"Return the context above @var{context} "
"where @var{name} is defined.")
return SCM_UNSPECIFIED;
}
-LY_DEFINE (is_contextarent, "ly:context-parent",
+LY_DEFINE (ly_context_parent, "ly:context-parent",
1, 0, 0, (SCM context),
"Return the parent of @var{context}, @code{#f} if none.")
{
return SCM_BOOL_F;
}
-
-#if 0
-/*
- What is this used for? Should remove? --hwn
- */
-LY_DEFINE (is_contextroperties, "ly:context-properties",
- 1, 0, 0, (SCM context),
- "Return all properties of @var{context} in an alist.")
-{
- Context *tr = unsmob_context (context);
- SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return tr->properties_as_alist ();
-}
-#endif
find_context_below (Context * where,
SCM type, String id)
{
- if (where->is_alias (ly_symbol2scm (type.to_str0 ())))
+ if (where->is_alias (type))
{
if (id == "" || where->id_string_ == id)
return where;
return SCM_UNDEFINED;
}
-LY_DEFINE (is_spanner, "ly:spanner?",
+LY_DEFINE (ly_spanner_p, "ly:spanner?",
1, 0, 0, (SCM g),
"Is @var{g} a spanner object?")
{
return ly_bool2scm (b);
}
-LY_DEFINE (is_item, "ly:item?",
+LY_DEFINE (ly_item_p, "ly:item?",
1, 0, 0, (SCM g),
"Is @var{g} an @code{Item} object?")
{
return SCM_BOOL_T;
}
-LY_DEFINE (is_dir, "ly:dir?", 1,0, 0, (SCM s),
+LY_DEFINE (ly_dir_p, "ly:dir?", 1,0, 0, (SCM s),
"type predicate. A direction is @code{-1}, @code{0} or "
"@code{1}, where @code{-1} represents "
"left or down and @code{1} represents right or up.")
return scm_makfrom0str (str);
}
-/*
- Undef this to see if GUILE GC is causing too many swaps.
- */
-
-//#define TEST_GC
-
-#ifdef TEST_GC
-#include <libguile/gc.h>
-
-static void *
-greet_sweep (void *dummy1, void *dummy2, void *dummy3)
-{
- fprintf (stderr, "entering sweep\n");
-}
-
-static void *
-wave_sweep_goodbye (void *dummy1, void *dummy2, void *dummy3)
-{
- fprintf (stderr, "leaving sweep\n");
-}
-#endif
LY_DEFINE (ly_version, "ly:version", 0, 0, 0, (),
-LY_DEFINE (is_dimension, "ly:dimension?", 1, 0, 0, (SCM d),
+LY_DEFINE (ly_dimension_p, "ly:dimension?", 1, 0, 0, (SCM d),
"Return @var{d} is a number. Used to distinguish length "
"variables from normal numbers.")
{
return scm_number_p (d);
}
-static void
-init_functions ()
-{
-#ifdef TEST_GC
- scm_c_hook_add (&scm_before_mark_c_hook, greet_sweep, 0, 0);
- scm_c_hook_add (&scm_before_sweep_c_hook, wave_sweep_goodbye, 0, 0);
-#endif
-}
-
-ADD_SCM_INIT_FUNC (funcs, init_functions);
-
SCM
ly_deep_copy (SCM src)
{