source file of the GNU LilyPond music typesetter
- (c) 1998--2007 Jan Nieuwenhuizen <janneke@gnu.org>
+ (c) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
Han-Wen Nienhuys <hanwen@xs4all.nl>
*/
LY_DEFINE (ly_dir_p, "ly:dir?",
1, 0, 0, (SCM s),
- "A type predicate. The direction@tie{}@code{s} is @code{-1},"
- " @code{0} or@tie{}@code{1}, where @code{-1} represents"
- " left or down and @code{1} represents right or up.")
+ "Is @var{s} a direction? Valid directions are @code{-1},"
+ " @code{0}, or@tie{}@code{1}, where @code{-1} represents"
+ " left or down, @code{1} represents right or up, and @code{0}"
+ " represents a neutral direction.")
{
if (scm_is_number (s))
{
LY_ASSERT_TYPE (scm_is_string, s, 3);
string ss = ly_scm2string (s);
- replace_all (ss, string (scm_i_string_chars (a)),
- string (scm_i_string_chars (b)));
+ replace_all (&ss, ly_scm2string (a),
+ ly_scm2string (b));
+
return ly_string2scm (ss);
}
}
LY_DEFINE (ly_gettext, "ly:gettext",
- 1, 0, 0, (SCM string),
+ 1, 0, 0, (SCM original),
"A Scheme wrapper function for @code{gettext}.")
{
- LY_ASSERT_TYPE (scm_is_string, string, 1);
- return ly_string2scm (_ (scm_i_string_chars (string)));
+ LY_ASSERT_TYPE (scm_is_string, original, 1);
+ return ly_string2scm (_ (ly_scm2string (original).c_str ()));
}
LY_DEFINE (ly_output_formats, "ly:output-formats",
}
LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",
- 2, 1, 0, (SCM key, SCM achain, SCM dfault),
+ 2, 1, 0, (SCM key, SCM achain, SCM val),
"Return value for @var{key} from a list of alists @var{achain}."
- " If no entry is found, return @var{dfault} or @code{#f} if no"
- " @var{dfault} is specified.")
+ " If no entry is found, return @var{val} or @code{#f} if"
+ " @var{val} is not specified.")
{
if (scm_is_pair (achain))
{
if (scm_is_pair (handle))
return scm_cdr (handle);
else
- return ly_chain_assoc_get (key, scm_cdr (achain), dfault);
+ return ly_chain_assoc_get (key, scm_cdr (achain), val);
}
- return dfault == SCM_UNDEFINED ? SCM_BOOL_F : dfault;
+ return val == SCM_UNDEFINED ? SCM_BOOL_F : val;
}
}
static SCM
-accumulate_symbol (void *closure, SCM key, SCM val, SCM result)
+accumulate_symbol (void * /* closure */,
+ SCM key,
+ SCM /* val */,
+ SCM result)
{
- (void) closure;
- (void) val;
return scm_cons (key, result);
}