(SCM name),
"Load the font @var{name}. ")
{
- LY_FUNC_NOTE_FIRST_ARG(name);
- LY_ASSERT_TYPE(scm_is_string,1);
+ LY_ASSERT_TYPE(scm_is_string, name, 1);
Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
Grob_array *ga = unsmob_grob_array (elements);
SCM_ASSERT_TYPE (ga || scm_is_pair (elements), elements, SCM_ARG1, __FUNCTION__, "list or Grob_array");
- LY_FUNC_NOTE_FIRST_ARG(elements);
- LY_ASSERT_SMOB(Grob, 2);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_SMOB(Grob, common, 2);
+ LY_ASSERT_TYPE(is_axis, axis, 3);
vector<Grob*> elts;
if (!ga)
"containing @code{\\scores}.")
{
Output_def *odef = unsmob_output_def (paper);
- LY_ASSERT_FIRST_SMOB (Output_def, paper)
+ LY_ASSERT_SMOB (Output_def, paper, 1);
Book *book = new Book;
book->paper_ = odef;
{
Book *book = unsmob_book (book_smob);
- LY_FUNC_NOTE_FIRST_ARG(book_smob);
- LY_ASSERT_SMOB(Book,1);
- LY_ASSERT_SMOB(Output_def, 2);
- LY_ASSERT_SMOB(Output_def, 3);
+ LY_ASSERT_SMOB(Book, book_smob, 1);
+ LY_ASSERT_SMOB(Output_def, default_paper, 2);
+ LY_ASSERT_SMOB(Output_def, default_layout, 3);
Paper_book *pb = book->process (unsmob_output_def (default_paper),
unsmob_output_def (default_layout));
"a string (for file based outputs) or a socket (for network based "
"output).")
{
- LY_ASSERT_FIRST_SMOB (Book, book_smob);
+ LY_ASSERT_SMOB (Book, book_smob, 1);
+ LY_ASSERT_SMOB(Output_def, default_paper, 2);
+ LY_ASSERT_SMOB(Output_def, default_layout, 3);
Book *book = unsmob_book (book_smob);
- LY_ASSERT_SMOB(Output_def, 2);
- LY_ASSERT_SMOB(Output_def, 3);
-
Paper_book *pb = book->process (unsmob_output_def (default_paper),
unsmob_output_def (default_layout));
if (pb)
{
Context *tr = unsmob_context (context);
- LY_ASSERT_FIRST_SMOB (Context, context);
+ LY_ASSERT_SMOB (Context, context, 1);
return ly_string2scm (tr->id_string ());
}
"i.e. for @code{\\context Voice = one .. } "
"return the symbol @code{Voice}.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
+ LY_ASSERT_SMOB (Context, context, 1);
Context *tr = unsmob_context (context);
{
Context *tr = unsmob_context (context);
- LY_ASSERT_FIRST_SMOB (Context, context);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_TYPE(ly_is_symbol, name, 2);
return updated_grob_properties (tr, name);
}
{
Context *tg = unsmob_context (context);
- LY_ASSERT_FIRST_SMOB (Context, context);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
- LY_ASSERT_TYPE(ly_is_symbol, 3);
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_TYPE(ly_is_symbol, grob, 2);
+ LY_ASSERT_TYPE(ly_is_symbol, eltprop, 3);
execute_pushpop_property (tg, grob, eltprop, val);
2, 0, 0, (SCM c, SCM name),
"Return the value of @var{name} from context @var{c}")
{
- LY_ASSERT_FIRST_SMOB (Context, c);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Context, c, 1);
+ LY_ASSERT_TYPE(ly_is_symbol, name, 2);
Context *t = unsmob_context (c);
return t->internal_get_property (name);
"Set value of property @var{name} in context @var{context} "
"to @var{val}.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_TYPE(ly_is_symbol, name, 2);
Context *tr = unsmob_context (context);
"Return the context above @var{context} "
"where @var{name} is defined.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_TYPE(ly_is_symbol,name, 2);
Context *tr = unsmob_context (context);
(SCM context, SCM name),
"Unset value of property @var{name} in context @var{context}.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_TYPE(ly_is_symbol,name, 2);
Context *tr = unsmob_context (context);
tr->unset_property (name);
1, 0, 0, (SCM context),
"Return the parent of @var{context}, @code{#f} if none.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
+ LY_ASSERT_SMOB (Context, context, 1);
Context *tr = unsmob_context (context);
tr = tr->get_parent_context ();
"Find a parent of @var{context} that has name or alias @var{name}. "
"Return @code{#f} if not found.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
- LY_ASSERT_TYPE(ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Context, context, 1);
+ LY_ASSERT_TYPE(ly_is_symbol,name, 2);
Context *tr = unsmob_context (context);
while (tr)
1, 0, 0, (SCM context),
"Return now-moment of context CONTEXT")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
+ LY_ASSERT_SMOB (Context, context, 1);
Context *ctx = unsmob_context (context);
return ctx->now_mom ().smobbed_copy ();
}
1, 0, 0, (SCM context),
"Return event-source of context CONTEXT")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
+ LY_ASSERT_SMOB (Context, context, 1);
Context *ctx = unsmob_context (context);
return ctx->event_source ()->self_scm ();
}
"Return a stream-distributor that distributes all events\n"
" from @var{context} and all its subcontexts.")
{
- LY_ASSERT_FIRST_SMOB (Context, context);
+ LY_ASSERT_SMOB (Context, context, 1);
Context *ctx = unsmob_context (context);
return ctx->events_below ()->self_scm ();
}
1, 0, 0, (SCM num),
"@var{num} printer points")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+ LY_ASSERT_TYPE (scm_is_number, num, 1);
return scm_from_double (point_constant
* scm_to_double (num));
}
1, 0, 0, (SCM num),
"@var{num} cm")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+ LY_ASSERT_TYPE (scm_is_number, num, 1);
return scm_from_double (cm_constant
* scm_to_double (num));
}
1, 0, 0, (SCM num),
"@var{num} inches")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+ LY_ASSERT_TYPE (scm_is_number, num, 1);
return scm_from_double (inch_constant
* scm_to_double (num));
}
1, 0, 0, (SCM num),
"@var{num} mm")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+ LY_ASSERT_TYPE (scm_is_number, num, 1);
return scm_from_double (mm_constant
* scm_to_double (num));
}
1, 0, 0, (SCM num),
"@var{num} bigpoints (1/72th inch)")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, num);
+ LY_ASSERT_TYPE (scm_is_number, num, 1);
return scm_from_double (bigpoint_constant
* scm_to_double (num));
}
Dispatcher *t = unsmob_dispatcher (to);
Dispatcher *f = unsmob_dispatcher (from);
- LY_ASSERT_FIRST_SMOB(Dispatcher, to);
- LY_ASSERT_SMOB(Dispatcher, 2);
+ LY_ASSERT_SMOB (Dispatcher, to, 1);
+ LY_ASSERT_SMOB(Dispatcher, from, 2);
t->register_as_listener (f);
Listener *l = unsmob_listener (list);
Dispatcher *d = unsmob_dispatcher (disp);
- LY_ASSERT_FIRST_SMOB(Listener, list);
- LY_ASSERT_SMOB(Dispatcher, 2);
+ LY_ASSERT_SMOB (Listener, list, 1);
+ LY_ASSERT_SMOB(Dispatcher, disp, 2);
for (int arg = SCM_ARG3; scm_is_pair (cl); cl = scm_cdr (cl), arg++)
{
Dispatcher *d = unsmob_dispatcher (disp);
Stream_event *e = unsmob_stream_event (ev);
- LY_ASSERT_FIRST_SMOB(Dispatcher, disp);
+ LY_ASSERT_SMOB (Dispatcher, disp, 1);
- LY_ASSERT_SMOB(Stream_event, 2);
+ LY_ASSERT_SMOB(Stream_event, ev, 2);
d->broadcast (e);
return SCM_UNDEFINED;
}
2, 0, 0, (SCM p1, SCM p2),
"Is @var{p1} shorter than @var{p2}?")
{
- LY_ASSERT_FIRST_SMOB(Duration, p1);
- LY_ASSERT_SMOB(Duration, 2);
+ LY_ASSERT_SMOB(Duration, p1, 1);
+ LY_ASSERT_SMOB(Duration, p2, 2);
Duration *a = unsmob_duration (p1);
Duration *b = unsmob_duration (p2);
"(whole, half, quarter, etc.) and a number of augmentation\n"
"dots. \n")
{
- LY_ASSERT_FIRST_TYPE (scm_is_integer, length);
+ LY_ASSERT_TYPE (scm_is_integer, length, 1);
int dots = 0;
if (dotcount != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE (scm_is_integer, 2);
+ LY_ASSERT_TYPE (scm_is_integer, dotcount,2);
dots = scm_to_int (dotcount);
}
bool compress = false;
if (num != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE (scm_is_number, 3);
+ LY_ASSERT_TYPE (scm_is_number,num, 3);
compress = true;
}
else
if (den != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE (scm_is_number, 4);
+ LY_ASSERT_TYPE (scm_is_number,den, 4);
compress = true;
}
else
1, 0, 0, (SCM dur),
"Extract the duration log from @var{dur}")
{
- LY_ASSERT_FIRST_SMOB (Duration, dur);
+ LY_ASSERT_SMOB (Duration, dur, 1);
return scm_from_int (unsmob_duration (dur)->duration_log ());
}
1, 0, 0, (SCM dur),
"Extract the dot count from @var{dur}")
{
- LY_ASSERT_FIRST_SMOB(Duration, dur);
+ LY_ASSERT_SMOB (Duration, dur, 1);
return scm_from_int (unsmob_duration (dur)->dot_count ());
}
1, 0, 0, (SCM d),
"The 2-logarithm of 1/@var{d}.")
{
- LY_ASSERT_FIRST_TYPE (scm_is_number, d);
+ LY_ASSERT_TYPE (scm_is_number, d, 1);
int log = intlog2 (scm_to_int (d));
return scm_from_int (log);
}
1, 0, 0, (SCM dur),
"The length of the duration as a Moment.")
{
- LY_ASSERT_FIRST_SMOB(Duration, dur);
+ LY_ASSERT_SMOB (Duration, dur, 1);
return Moment (unsmob_duration (dur)->get_length ()).smobbed_copy ();
}
1, 0, 0, (SCM dur),
"Convert @var{dur} to string.")
{
- LY_ASSERT_FIRST_SMOB(Duration, dur);
+ LY_ASSERT_SMOB (Duration, dur, 1);
return ly_string2scm (unsmob_duration (dur)->to_string ());
}
1, 0, 0, (SCM dur),
"Extract the compression factor from @var{dur}. Return as a pair.")
{
- LY_ASSERT_FIRST_SMOB(Duration, dur);
+ LY_ASSERT_SMOB (Duration, dur, 1);
Rational r = unsmob_duration (dur)->factor ();
return scm_cons (scm_from_int (r.num ()), scm_from_int (r.den ()));
}
"the grob to be created and the corresponding line number in the "
"C++ source file.")
{
- LY_ASSERT_FIRST_TYPE (ly_is_procedure, cb);
+ LY_ASSERT_TYPE (ly_is_procedure, cb, 1);
creation_callback = cb;
(SCM name),
"Get the file for font @var{name}")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+ LY_ASSERT_TYPE (scm_is_string, name, 1);
FcPattern*pat = FcPatternCreate ();
FcValue val;
"is not available, return @code{#f}.")
{
Font_metric *fm = unsmob_metrics (font);
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
+ LY_ASSERT_TYPE(scm_is_string,name, 2);
Stencil m = fm->find_by_name (ly_scm2string (name));
"in @var{font}.")
{
Font_metric *fm = unsmob_metrics (font);
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
- LY_ASSERT_TYPE(scm_is_number, 2);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
+ LY_ASSERT_TYPE(scm_is_number, index,2);
return fm->get_ascii_char_stencil (scm_to_int (index)).smobbed_copy ();
}
"Return the index for @var{name} in @var{font}.")
{
Font_metric *fm = unsmob_metrics (font);
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
+ LY_ASSERT_TYPE(scm_is_string,name, 2);
return scm_from_int (fm->name_to_index (ly_scm2string (name)));
}
"Return the character code for @var{index} @var{font}.")
{
Font_metric *fm = unsmob_metrics (font);
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
- LY_ASSERT_TYPE(scm_is_integer, 2);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
+ LY_ASSERT_TYPE(scm_is_integer,index, 2);
return scm_from_unsigned_integer (fm->index_to_charcode (scm_to_int (index)));
}
"Return the character code for glyph @var{name} in @var{font}.")
{
Font_metric *fm = unsmob_metrics (font);
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
+ LY_ASSERT_TYPE(scm_is_string,name, 2);
return scm_from_unsigned_integer (fm->index_to_charcode (fm->name_to_index (ly_scm2string (name))));
}
Modified_font_metric *fm = dynamic_cast<Modified_font_metric *>
(unsmob_metrics (font));
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
+ LY_ASSERT_TYPE(scm_is_string,text, 2);
Stencil stc (fm->text_stencil (ly_scm2string (text)));
return scm_cons (ly_interval2scm (stc.extent (X_AXIS)),
ly_interval2scm (stc.extent (Y_AXIS)));
"Given the font metric @var{font}, "
"return the corresponding file name.")
{
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
Font_metric *fm = unsmob_metrics (font);
SCM name = fm->font_file_name ();
"Given the font metric @var{font}, "
"return the corresponding name.")
{
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
Font_metric *fm = unsmob_metrics (font);
return ly_string2scm (fm->font_name ());
"Given the font metric @var{font}, return the "
"magnification, relative to the current output-scale.")
{
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
Font_metric *fm = unsmob_metrics (font);
return scm_cdr (fm->description_);
"Given the font metric @var{font}, return the "
"design size, relative to the current output-scale.")
{
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
Font_metric *fm = unsmob_metrics (font);
return scm_from_double (fm->design_size ());
"Return the absolute file name of @var{name}, "
"or @code{#f} if not found.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+ LY_ASSERT_TYPE (scm_is_string, name, 1);
string nm = ly_scm2string (name);
string file_name = global_path.find (nm);
"Read the file @var{name}, and return its contents in a string. "
"The file is looked up using the search path. ")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+ LY_ASSERT_TYPE (scm_is_string, name, 1);
int sz = INT_MAX;
if (size != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_number, 2);
+ LY_ASSERT_TYPE(scm_is_number,size, 2);
sz = scm_to_int (size);
}
"Scheme callable function to issue the error @code{msg}. "
"The error is formatted with @code{format} and @code{rest}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
error (ly_scm2string (str));
return SCM_UNSPECIFIED;
"Scheme callable function to issue the message @code{msg}. "
"The message is formatted with @code{format} and @code{rest}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
message (ly_scm2string (str));
return SCM_UNSPECIFIED;
"Scheme callable function to print progress @code{str}. "
"The message is formatted with @code{format} and @code{rest}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
progress_indication (ly_scm2string (str));
return SCM_UNSPECIFIED;
"Scheme callable function to issue the warning @code{msg}. "
"The message is formatted with @code{format} and @code{rest}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
programming_error (ly_scm2string (str));
return SCM_UNSPECIFIED;
"Scheme callable function to issue the warning @code{str}. "
"The message is formatted with @code{format} and @code{rest}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
str = scm_simple_format (SCM_BOOL_F, str, rest);
warning (ly_scm2string (str));
return SCM_UNSPECIFIED;
3, 0, 0, (SCM a, SCM b, SCM s),
"Replace @var{a} by @var{b} in @var{s}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, s);
- LY_ASSERT_TYPE(scm_is_string, 2);
- LY_ASSERT_TYPE(scm_is_string, 3);
+ LY_ASSERT_TYPE (scm_is_string, s, 1);
+ LY_ASSERT_TYPE(scm_is_string,b, 2);
+ LY_ASSERT_TYPE(scm_is_string,s, 3);
string ss = ly_scm2string (s);
replace_all (ss, string (scm_i_string_chars (a)),
1, 0, 0, (SCM s),
"Convert @var{num} to a string without generating many decimals.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, s);
+ LY_ASSERT_TYPE (scm_is_number, s, 1);
char str[400]; // ugh.
1, 0, 0, (SCM string),
"Gettext wrapper.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, string);
+ LY_ASSERT_TYPE (scm_is_string, string, 1);
return ly_string2scm (_ (scm_i_string_chars (string)));
}
{
char buf[5];
- LY_ASSERT_FIRST_TYPE(scm_is_integer, wc);
+ LY_ASSERT_TYPE (scm_is_integer, wc, 1);
unsigned wide_char = (unsigned) scm_to_int (wc);
char *p = buf;
1, 1, 0, (SCM file_name, SCM mode),
"Redirect stderr to FILE-NAME, opened with MODE.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, file_name);
+ LY_ASSERT_TYPE (scm_is_string, file_name, 1);
string m = "w";
if (mode != SCM_UNDEFINED && scm_string_p (mode))
1, 0, 0, (SCM name_sym),
"Convert FooBar_Bla to foo-bar-bla style symbol.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_symbol, name_sym);
+ LY_ASSERT_TYPE (ly_is_symbol, name_sym, 1);
/*
TODO: should use strings instead?
1, 0, 0, (SCM str),
"Expand $VAR and $@{VAR@} in @var{str}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
return ly_string2scm (expand_environment_variables (ly_scm2string (str)));
}
2, 0, 0, (SCM lst, SCM i),
"Take at most the first @var{i} of list @var{lst}")
{
- LY_ASSERT_FIRST_TYPE(scm_is_integer, i);
+ LY_ASSERT_TYPE (scm_is_integer, i, 1);
int k = scm_to_int (i);
if (k == 0)
1, 0, 1, (SCM str, SCM rest),
"LilyPond specific format, supporting ~a ~[0-9]f.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
string format = ly_scm2string (str);
vector<string> results;
{
Global_context *g = dynamic_cast<Global_context *> (unsmob_context (context));
- LY_ASSERT_FIRST_TYPE (unsmob_global_context, context)
+ LY_ASSERT_TYPE (unsmob_global_context, context, 1)
SCM output = g->get_output ();
progress_indication ("\n");
"@var{global}. The translator group is returned.")
{
Global_context *g = dynamic_cast<Global_context *> (unsmob_context (global));
- LY_ASSERT_FIRST_TYPE (unsmob_global_context, global)
+ LY_ASSERT_TYPE (unsmob_global_context, global, 1)
Translator_group *tg = new Translator_group ();
tg->connect_to_context (g);
"The context is returned.\n"
)
{
- LY_ASSERT_FIRST_SMOB (Output_def, output_def);
+ LY_ASSERT_SMOB (Output_def, output_def, 1);
Output_def *odef = unsmob_output_def (output_def);
Global_context *glob = new Global_context (odef);
"global context @var{ctx}. The context is returned in its\n"
"final state.\n")
{
- LY_ASSERT_FIRST_SMOB (Music, mus);
- LY_ASSERT_TYPE (unsmob_global_context, 2);
+ LY_ASSERT_SMOB (Music, mus, 1);
+ LY_ASSERT_TYPE (unsmob_global_context,ctx, 2);
Music *music = unsmob_music (mus);
if (!music
"Optionally, this routine takes an Object-key to\n"
"to uniquely identify the Score block containing it.\n")
{
- LY_ASSERT_FIRST_SMOB (Music, mus);
- LY_ASSERT_SMOB (Output_def, 2);
+ 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);
(SCM grob_arr),
"Return the grob_array length.")
{
- LY_ASSERT_FIRST_SMOB (Grob_array, grob_arr);
+ LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
Grob_array *me = unsmob_grob_array (grob_arr);
return scm_from_int (me->size ());
"Retrieve the @code{index} element of @code{grob-arr}.")
{
Grob_array *me = unsmob_grob_array (grob_arr);
- LY_ASSERT_FIRST_SMOB (Grob_array, grob_arr);
- LY_ASSERT_TYPE(scm_is_integer, 2);
+ LY_ASSERT_SMOB (Grob_array, grob_arr, 1);
+ LY_ASSERT_TYPE(scm_is_integer,index, 2);
vsize i = scm_to_unsigned (index);
if (i == VPOS || i >= me->size ())
3, 0, 0, (SCM a, SCM b, SCM c),
"Add an interface description.")
{
- LY_ASSERT_FIRST_TYPE (ly_is_symbol, a);
- LY_ASSERT_TYPE(scm_is_string, 2);
- LY_ASSERT_TYPE(ly_is_list, 3);
+ LY_ASSERT_TYPE (ly_is_symbol, a, 1);
+ LY_ASSERT_TYPE(scm_is_string,b, 2);
+ LY_ASSERT_TYPE(ly_is_list,c, 3);
if (!all_ifaces)
{
SCM tab = scm_c_make_hash_table (59);
"which the modification was requested, the property to be changed and "
"the new value for the property.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_procedure, cb);
+ LY_ASSERT_TYPE (ly_is_procedure, cb, 1);
modification_callback = cb;
return SCM_UNSPECIFIED;
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
return sc->get_property_data (sym);
}
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
if (!ly_is_procedure (val)
&& !type_check_assignment (sym, val, ly_symbol2scm ("backend-type?")))
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
if (deflt == SCM_UNDEFINED)
deflt = SCM_EOL;
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
return sc->interfaces ();
}
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
return sc->internal_get_object (sym);
}
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
return sc->layout ()->self_scm ();
}
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
if (global == SCM_UNDEFINED)
{
Grob *ref = unsmob_grob (refp);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_SMOB(Grob, 2);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_SMOB(Grob, refp, 2);
+ LY_ASSERT_TYPE(is_axis,axis, 3);
Axis a = Axis (scm_to_int (axis));
Grob *ref = unsmob_grob (refp);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_SMOB(Grob, 2);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_SMOB(Grob, refp, 2);
+ LY_ASSERT_TYPE(is_axis,axis, 3);
Axis a = Axis (scm_to_int (axis));
Grob *ref = unsmob_grob (refp);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_SMOB(Grob, 2);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_SMOB(Grob,refp, 2);
+ LY_ASSERT_TYPE(is_axis,axis, 3);
Axis a = Axis (scm_to_int (axis));
{
Grob *sc = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_TYPE(is_axis, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_TYPE(is_axis,axis, 2);
Grob *par = sc->get_parent (Axis (scm_to_int (axis)));
return par ? par->self_scm () : SCM_EOL;
{
Grob *g = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
/* FIXME: uhg? copy/read only? */
return g->mutable_property_alist_;
{
Grob *g = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
/* FIXME: uhg? copy/read only? */
return g->immutable_property_alist_;
{
Grob *me = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
if (System *g = me->get_system ())
return g->self_scm ();
{
Grob *me = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
return me->original () ? me->original ()->self_scm () : me->self_scm ();
}
{
Grob *me = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
me->suicide ();
return SCM_UNSPECIFIED;
{
Grob *me = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_TYPE(scm_is_number, 2);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_TYPE(scm_is_number,d, 2);
+ LY_ASSERT_TYPE(is_axis,a, 3);
me->translate_axis (scm_to_double (d), Axis (scm_to_int (a)));
return SCM_UNSPECIFIED;
{
Grob *gr = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
+ LY_ASSERT_SMOB (Grob, grob, 1);
return Font_interface::get_default_font (gr)->self_scm ();
}
Grob *gr = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_SMOB(Grob, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_SMOB(Grob,other, 2);
Grob *o = unsmob_grob (other);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_TYPE(is_axis,axis, 3);
Grob *refp = gr->common_refpoint (o, Axis (scm_to_int (axis)));
return refp ? refp->self_scm () : SCM_BOOL_F;
{
Grob *gr = unsmob_grob (grob);
- LY_ASSERT_FIRST_SMOB(Grob, grob);
- LY_ASSERT_SMOB(Grob_array, 2);
+ LY_ASSERT_SMOB (Grob, grob, 1);
+ LY_ASSERT_SMOB(Grob_array,others, 2);
Grob_array *ga = unsmob_grob_array (others);
- LY_ASSERT_TYPE(is_axis, 3);
+ LY_ASSERT_TYPE(is_axis,axis, 3);
Grob *refp = common_refpoint_of_array (ga->array (), gr, Axis (scm_to_int (axis)));
return refp ? refp->self_scm () : SCM_BOOL_F;
#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 */
{
Input *ip = unsmob_input (sip);
- LY_ASSERT_FIRST_TYPE (unsmob_input, sip);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_TYPE (unsmob_input, sip, 1);
+ LY_ASSERT_TYPE(scm_is_string, msg,2);
msg = scm_simple_format (SCM_BOOL_F, msg, rest);
1, 0, 0, (SCM sip),
"Return input location in @var{sip} as (file-name line char column).")
{
- LY_ASSERT_FIRST_TYPE (unsmob_input, sip);
+ LY_ASSERT_TYPE (unsmob_input, sip, 1);
Input *ip = unsmob_input (sip);
int l = 0;
"(file-name first-line first-column last-line last-column).")
{
- LY_ASSERT_FIRST_TYPE (unsmob_input, sip);
+ LY_ASSERT_TYPE (unsmob_input, sip, 1);
Input *ip = unsmob_input (sip);
return scm_list_5 (ly_string2scm (ip->file_string ()),
"The break status dir of item @var{it}. @code{-1} is end of "
"line, @code{0} unbroken, and @code{1} begin of line.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_item, it);
+ LY_ASSERT_TYPE (unsmob_item, it, 1);
Item *me = unsmob_item (it);
return scm_from_int (me->break_status_dir ());
}
char *
ly_scm2newstr (SCM str, size_t *lenp)
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, str);
+ LY_ASSERT_TYPE (scm_is_string, str, 1);
size_t len = scm_i_string_length (str);
if (char *new_str = (char *) malloc ((len + 1) * sizeof (char)))
1, 0, 0, (SCM lexer),
"Return a list of (KEY . CODE) pairs, signifying the lilypond reserved words list.")
{
- LY_ASSERT_FIRST_SMOB(Lily_lexer, lexer);
+ LY_ASSERT_SMOB (Lily_lexer, lexer, 1);
Lily_lexer * lex = Lily_lexer::unsmob (lexer);
return lex->keyword_list ();
"Parse a single @code{.ly} file. "
"Upon failure, throw @code{ly-file-failed} key.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, name);
+ LY_ASSERT_TYPE (scm_is_string, name, 1);
string file = ly_scm2string (name);
char const *extensions[] = {"ly", "", 0};
1, 0, 0, (SCM parser_smob),
"Return a clone of @var{parser-smob}.")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+ LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
Lily_parser *parser = unsmob_lily_parser (parser_smob);
Lily_parser *clone = new Lily_parser (*parser);
"Bind @var{symbol} to @var{val} in @var{parser-smob}'s module.")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+ LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
Lily_parser *parser = unsmob_lily_parser (parser_smob);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
parser->lexer_->set_identifier (scm_symbol_to_string (symbol), val);
return SCM_UNSPECIFIED;
"Lookup @var{symbol} in @var{parser-smob}'s module. "
"Undefined is '().")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+ LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
Lily_parser *parser = unsmob_lily_parser (parser_smob);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol,symbol, 2);
SCM val = parser->lexer_->lookup_identifier (ly_scm2string (scm_symbol_to_string (symbol)));
if (val != SCM_UNDEFINED)
"Parse the string @code{ly-code} with @code{parser-smob}."
"Upon failure, throw @code{ly-file-failed} key.")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser_smob);
+ LY_ASSERT_SMOB (Lily_parser, parser_smob, 1);
Lily_parser *parser = unsmob_lily_parser (parser_smob);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_TYPE(scm_is_string,ly_code, 2);
parser->parse_string (ly_scm2string (ly_code));
"@var{names} is an alist of symbols. "
"This only has effect if the current mode is notes.")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+ LY_ASSERT_SMOB (Lily_parser, parser, 1);
Lily_parser *p = unsmob_lily_parser (parser);
if (p->lexer_->is_note_state ())
1, 0, 0, (SCM parser),
"Return the base name of the output file.")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+ LY_ASSERT_SMOB (Lily_parser, parser, 1);
Lily_parser *p = unsmob_lily_parser (parser);
return ly_string2scm (p->output_basename_);
2, 1, 0, (SCM parser, SCM msg, SCM input),
"Display an error message, and make the parser fail")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+ LY_ASSERT_SMOB (Lily_parser, parser, 1);
Lily_parser *p = unsmob_lily_parser (parser);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_TYPE(scm_is_string,msg, 2);
string s = ly_scm2string (msg);
Input *i = unsmob_input (input);
1, 0, 0, (SCM parser),
"Clear the error flag for the parser.")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+ LY_ASSERT_SMOB (Lily_parser, parser, 1);
Lily_parser *p = unsmob_lily_parser (parser);
1, 0, 0, (SCM parser),
"Does @var{parser} have an error flag?")
{
- LY_ASSERT_FIRST_SMOB (Lily_parser, parser);
+ LY_ASSERT_SMOB (Lily_parser, parser, 1);
Lily_parser *p = unsmob_lily_parser (parser);
return scm_from_bool (p->error_level_ || p->lexer_->error_level_);
"notes, and @var{g} the timing for grace notes. "
"In absence of grace notes, @var{g} is zero.\n")
{
- LY_ASSERT_FIRST_TYPE(scm_is_integer, n);
- LY_ASSERT_TYPE(scm_is_integer, 2);
+ LY_ASSERT_TYPE (scm_is_integer, n, 1);
+ LY_ASSERT_TYPE(scm_is_integer,d, 2);
int grace_num = 0;
if (gn != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_integer, 3);
+ LY_ASSERT_TYPE(scm_is_integer,gn, 3);
grace_num = scm_to_int (gn);
}
int grace_den = 1;
if (gd != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_integer, 4);
+ LY_ASSERT_TYPE(scm_is_integer,gd, 4);
grace_den = scm_to_int (gd);
}
2, 0, 0, (SCM a, SCM b),
"Subtract two moments.")
{
- LY_ASSERT_FIRST_SMOB (Moment, a);
- LY_ASSERT_SMOB (Moment, 2);
+ LY_ASSERT_SMOB (Moment, a, 1);
+ LY_ASSERT_SMOB (Moment,b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
2, 0, 0, (SCM a, SCM b),
"Add two moments.")
{
- LY_ASSERT_FIRST_SMOB(Moment, a);
- LY_ASSERT_SMOB(Moment, 2);
+ LY_ASSERT_SMOB (Moment, a, 1);
+ LY_ASSERT_SMOB(Moment,b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
2, 0, 0, (SCM a, SCM b),
"Multiply two moments.")
{
- LY_ASSERT_FIRST_SMOB(Moment, a);
- LY_ASSERT_SMOB(Moment, 2);
+ LY_ASSERT_SMOB (Moment, a, 1);
+ LY_ASSERT_SMOB(Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
2, 0, 0, (SCM a, SCM b),
"Divide two moments.")
{
- LY_ASSERT_FIRST_SMOB(Moment, a);
- LY_ASSERT_SMOB(Moment, 2);
+ LY_ASSERT_SMOB (Moment, a, 1);
+ LY_ASSERT_SMOB(Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
2, 0, 0, (SCM a, SCM b),
"Modulo of two moments.")
{
- LY_ASSERT_FIRST_SMOB(Moment, a);
- LY_ASSERT_SMOB(Moment, 2);
+ LY_ASSERT_SMOB (Moment, a, 1);
+ LY_ASSERT_SMOB(Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
1, 0, 0, (SCM mom),
"Extract numerator from grace timing.")
{
- LY_ASSERT_FIRST_SMOB (Moment, mom);
+ LY_ASSERT_SMOB (Moment, mom, 1);
Moment *ma = unsmob_moment (mom);
1, 0, 0, (SCM mom),
"Extract denominator from grace timing.")
{
- LY_ASSERT_FIRST_SMOB (Moment, mom);
+ LY_ASSERT_SMOB (Moment, mom, 1);
Moment *ma = unsmob_moment (mom);
return scm_from_int (ma->grace_part_.denominator ());
1, 0, 0, (SCM mom),
"Extract numerator from main timing.")
{
- LY_ASSERT_FIRST_SMOB (Moment, mom);
+ LY_ASSERT_SMOB (Moment, mom, 1);
Moment *ma = unsmob_moment (mom);
return scm_from_int (ma->main_part_.numerator ());
1, 0, 0, (SCM mom),
"Extract denominator from main timing.")
{
- LY_ASSERT_FIRST_SMOB (Moment, mom);
+ LY_ASSERT_SMOB (Moment, mom, 1);
Moment *ma = unsmob_moment (mom);
return scm_from_int (ma->main_part_.denominator ());
2, 0, 0, (SCM a, SCM b),
"Compare two moments.")
{
- LY_ASSERT_FIRST_SMOB(Moment, a);
- LY_ASSERT_SMOB (Moment, 2);
+ LY_ASSERT_SMOB (Moment, a, 1);
+ LY_ASSERT_SMOB (Moment, b, 2);
Moment *ma = unsmob_moment (a);
Moment *mb = unsmob_moment (b);
(SCM x),
"Return the Scheme function inside @var{x}")
{
- LY_ASSERT_FIRST_TYPE(is_music_function, x);
+ LY_ASSERT_TYPE (is_music_function, x, 1);
return SCM_CELL_OBJECT_1(x);
}
"Its arguments. @code{signature} is a list containing either "
"@code{ly:music?} predicates or other type predicates.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_procedure, func);
+ LY_ASSERT_TYPE (ly_is_procedure, func, 1);
return make_music_function (signature, func);
}
1, 0, 0, (SCM mus),
"Get the length of music expression @var{mus}, and return as a @code{Moment} object.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+ LY_ASSERT_TYPE (unsmob_music, mus, 1);
Music *sc = unsmob_music (mus);
return sc->get_length ().smobbed_copy ();
}
"Get the property @var{sym} of music expression @var{mus}.\n"
"If @var{sym} is undefined, return @code{'()}.\n")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+ LY_ASSERT_TYPE (unsmob_music, mus, 1);
return ly_prob_property (mus,sym,dfault);
}
3, 0, 0, (SCM mus, SCM sym, SCM val),
"Set property @var{sym} in music expression @var{mus} to @var{val}.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+ LY_ASSERT_TYPE (unsmob_music, mus, 1);
return ly_prob_set_property_x (mus, sym, val);
}
"they are constant and initialized by the "
"@code{make-music} function.\n")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+ LY_ASSERT_TYPE (unsmob_music, mus, 1);
Music *m = unsmob_music (mus);
return m->get_property_alist (true);
}
"Transpose @var{m} such that central C is mapped to @var{p}. "
"Return @var{m}.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, m);
- LY_ASSERT_SMOB (Pitch, 2);
+ LY_ASSERT_TYPE (unsmob_music, m, 1);
+ LY_ASSERT_SMOB (Pitch, p, 2);
Music *sc = unsmob_music (m);
Pitch *sp = unsmob_pitch (p);
2, 0, 0, (SCM m, SCM factor),
"Compress music object @var{m} by moment @var{factor}.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, m);
- LY_ASSERT_TYPE(unsmob_moment, 2);
+ LY_ASSERT_TYPE (unsmob_music, m, 1);
+ LY_ASSERT_TYPE(unsmob_moment,factor, 2);
Music *sc = unsmob_music (m);
sc->compress (*unsmob_moment (factor));
(SCM mus),
"Extract the duration field from @var{mus}, and return the length.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
+ LY_ASSERT_TYPE (unsmob_music, mus, 1);
Music *m = unsmob_music (mus);
Duration *d = unsmob_duration (m->get_property ("duration"));
(SCM mus, SCM fact),
"Compress @var{mus} by factor @var{fact}, which is a @code{Moment}.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_music, mus);
- LY_ASSERT_SMOB (Moment, 2);
+ LY_ASSERT_TYPE (unsmob_music, mus, 1);
+ LY_ASSERT_SMOB (Moment, fact, 2);
Music *m = unsmob_music (mus);
Moment *f = unsmob_moment (fact);
"Get attachment in @var{font-metric} for attaching a stem to notehead "
"@var{glyph-name}.")
{
- LY_ASSERT_FIRST_SMOB (Font_metric, font_metric);
+ LY_ASSERT_SMOB (Font_metric, font_metric, 1);
Font_metric *fm = unsmob_metrics (font_metric);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_TYPE(scm_is_string,glyph_name, 2);
return ly_offset2scm (Note_head::get_stem_attachment (fm, ly_scm2string (glyph_name)));
}
"Given the font metric @var{font} of an OpenType font, return the "
"names of the subfonts within @var{font}.")
{
- LY_ASSERT_FIRST_SMOB (Font_metric, font);
+ LY_ASSERT_SMOB (Font_metric, font, 1);
Font_metric *fm = unsmob_metrics (font);
return fm->sub_fonts ();
}
= dynamic_cast<Modified_font_metric *> (unsmob_metrics (font));
Open_type_font *otf = dynamic_cast<Open_type_font *> (fm->original_font ());
- LY_FUNC_NOTE_FIRST_ARG (font);
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "OTF font-metric");
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_TYPE(scm_is_string, glyph, 2);
SCM sym = scm_string_to_symbol (glyph);
return scm_hashq_ref (otf->get_char_table (), sym, SCM_EOL);
: dynamic_cast<Open_type_font *> (unsmob_metrics (font));
SCM_ASSERT_TYPE (otf, font, SCM_ARG1, __FUNCTION__, "Open type font");
- LY_FUNC_NOTE_FIRST_ARG (font);
- LY_ASSERT_TYPE (scm_is_string, 2);
+ LY_ASSERT_TYPE (scm_is_string, tag, 2);
char ctag [5] = " ";
"Lookup @var{sym} in the Output_def @var{pap}. "
"Return the value or @var{def} (which defaults to @code{'()}) if undefined.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, pap);
+ LY_ASSERT_SMOB (Output_def, pap, 1);
Output_def *op = unsmob_output_def (pap);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
SCM answer = op->lookup_variable (sym);
if (answer == SCM_UNDEFINED)
1, 0, 0, (SCM def),
"Get the variable scope inside @var{def}.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, def);
+ LY_ASSERT_SMOB (Output_def, def, 1);
Output_def *op = unsmob_output_def (def);
return op->scope_;
}
1, 0, 0, (SCM def),
"Get the parent output-def of @var{def}.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, def);
+ LY_ASSERT_SMOB (Output_def, def, 1);
Output_def *op = unsmob_output_def (def);
return op->parent_ ? op->parent_->self_scm () : SCM_EOL;
}
1, 0, 0, (SCM def),
"Clone @var{def}.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, def);
+ LY_ASSERT_SMOB (Output_def, def, 1);
Output_def *op = unsmob_output_def (def);
Output_def *clone = op->clone ();
1, 0, 0, (SCM bp),
"Get output-scale for BP.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, bp);
+ LY_ASSERT_SMOB (Output_def, bp, 1);
Output_def *b = unsmob_output_def (bp);
return scm_from_double (output_scale (b));
}
"(An alist chain is a list of alists, "
"containing grob properties).\n")
{
- LY_ASSERT_FIRST_SMOB (Output_def, paper_smob);
+ LY_ASSERT_SMOB (Output_def, paper_smob, 1);
Output_def *paper = unsmob_output_def (paper_smob);
Font_metric *fm = select_font (paper, chain);
"Return the layout variable @var{name}.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, layout_smob);
+ LY_ASSERT_SMOB (Output_def, layout_smob, 1);
Output_def *layout = unsmob_output_def (layout_smob);
return scm_from_double (layout->get_dimension (name));
}
(SCM bp),
"Return fonts from the @code{\\paper} block @var{bp}.")
{
- LY_ASSERT_FIRST_SMOB (Output_def, bp);
+ LY_ASSERT_SMOB (Output_def, bp, 1);
Output_def *b = unsmob_output_def (bp);
SCM tab1 = b->lookup_variable (ly_symbol2scm ("scaled-fonts"));
2, 0, 0, (SCM chain, SCM size),
"Make a PangoFontDescription string for the property alist @var{chain} at size @var{size}.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_number, size);
+ LY_ASSERT_TYPE (scm_is_number, size, 1);
PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size));
char *str = pango_font_description_to_string (pfd);
1, 0, 0, (SCM pb),
"Return pages in book PB.")
{
- LY_ASSERT_FIRST_SMOB (Paper_book, pb);
+ LY_ASSERT_SMOB (Paper_book, pb, 1);
return unsmob_paper_book (pb)->pages ();
}
1, 0, 0, (SCM book),
"Return pages in layout book @var{book}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_book, book);
+ LY_ASSERT_SMOB (Paper_book, book, 1);
Paper_book *pb = unsmob_paper_book (book);
SCM scopes = SCM_EOL;
1, 0, 0, (SCM paper_book),
"Return performances in book @var{paper-book}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_book, paper_book);
+ LY_ASSERT_SMOB (Paper_book, paper_book, 1);
return unsmob_paper_book (paper_book)->performances ();
}
1, 0, 0, (SCM pb),
"Return systems in book PB.")
{
- LY_ASSERT_FIRST_SMOB (Paper_book, pb);
+ LY_ASSERT_SMOB (Paper_book, pb, 1);
return unsmob_paper_book (pb)->systems ();
}
1, 0, 0, (SCM pb),
"Return pages in book PB.")
{
- LY_ASSERT_FIRST_SMOB (Paper_book, pb);
+ LY_ASSERT_SMOB (Paper_book, pb, 1);
Paper_book *pbook = unsmob_paper_book (pb);
return pbook->paper_->self_scm ();
}
"Create an outputter that evaluates within "
"@code{output-}@var{format}, writing to @var{port}.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_port, port);
- LY_ASSERT_TYPE (scm_is_string, 2);
+ LY_ASSERT_TYPE (ly_is_port, port, 1);
+ LY_ASSERT_TYPE (scm_is_string, format, 2);
string f = ly_scm2string (format);
"Dump stencil @var{expr} onto @var{outputter}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
- LY_ASSERT_SMOB(Stencil, 2);
+ LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
+ LY_ASSERT_SMOB(Stencil, stencil, 2);
Paper_outputter *po = unsmob_outputter (outputter);
Stencil *st = unsmob_stencil (stencil);
2, 0, 0, (SCM outputter, SCM str),
"Dump @var{str} onto @var{outputter}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
+ LY_ASSERT_TYPE(scm_is_string, str, 2);
Paper_outputter *po = unsmob_outputter (outputter);
1, 0, 0, (SCM outputter),
"Return output port for @var{outputter}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
+ LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
Paper_outputter *po = unsmob_outputter (outputter);
return po->file ();
1, 0, 0, (SCM outputter),
"Close port of @var{outputter}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
+ LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
Paper_outputter *po = unsmob_outputter (outputter);
po->close ();
2, 0, 0, (SCM outputter, SCM expr),
"Eval @var{expr} in module of @var{outputter}.")
{
- LY_ASSERT_FIRST_SMOB (Paper_outputter, outputter);
+ LY_ASSERT_SMOB (Paper_outputter, outputter, 1);
Paper_outputter *po = unsmob_outputter (outputter);
po->output_scheme (expr);
(SCM paper_score),
"Return vector of paper_system objects from @var{paper-score}.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_paper_score, paper_score);
+ LY_ASSERT_TYPE (unsmob_paper_score, paper_score, 1);
Paper_score *pscore = dynamic_cast<Paper_score *> (unsmob_music_output (paper_score));
return pscore->get_paper_systems ();
2, 0, 0, (SCM performance, SCM filename),
"Write @var{performance} to @var{filename}")
{
- LY_ASSERT_FIRST_TYPE (unsmob_performance, performance);
- LY_ASSERT_TYPE(scm_is_string, 2);
+ LY_ASSERT_TYPE (unsmob_performance, performance, 1);
+ LY_ASSERT_TYPE(scm_is_string, filename, 2);
unsmob_performance (performance)->write_output (ly_scm2string (filename));
return SCM_UNSPECIFIED;
1, 0, 0, (SCM pfb_file_name),
"Convert the contents of a PFB file to PFA.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, pfb_file_name);
+ LY_ASSERT_TYPE (scm_is_string, pfb_file_name, 1);
string file_name = ly_scm2string (pfb_file_name);
"Convert the contents of a OTF file to CFF file, returning it as "
" a string.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, otf_file_name);
+ LY_ASSERT_TYPE (scm_is_string, otf_file_name, 1);
string file_name = ly_scm2string (otf_file_name);
if (be_verbose_global)
"Transpose @var{p} by the amount @var{delta}, "
"where @var{delta} is relative to middle C.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, p);
- LY_ASSERT_SMOB (Pitch, 2);
+ LY_ASSERT_SMOB (Pitch, p, 1);
+ LY_ASSERT_SMOB (Pitch, delta, 2);
Pitch *t = unsmob_pitch (p);
Pitch *d = unsmob_pitch (delta);
"with 0 corresponding to C and 6 corresponding to B. "
"The @var{alter} is a rational number of whole tones for alteration.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_integer, octave);
- LY_ASSERT_TYPE(scm_is_integer, 2);
- LY_ASSERT_TYPE(scm_is_rational, 3);
+ LY_ASSERT_TYPE (scm_is_integer, octave, 1);
+ LY_ASSERT_TYPE(scm_is_integer, note, 2);
+ LY_ASSERT_TYPE(scm_is_rational, alter, 3);
Pitch p (scm_to_int (octave), scm_to_int (note),
ly_scm2rational (alter));
(SCM p),
"Negate @var{p}.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, p);
+ LY_ASSERT_SMOB (Pitch, p, 1);
Pitch *pp = unsmob_pitch (p);
return pp->negated ().smobbed_copy ();
}
(SCM p),
"Number of steps counted from middle C of the pitch @var{p}.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, p);
+ LY_ASSERT_SMOB (Pitch, p, 1);
Pitch *pp = unsmob_pitch (p);
return scm_from_int (pp->steps ());
}
1, 0, 0, (SCM pp),
"Extract the octave from pitch @var{p}.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, pp);
+ LY_ASSERT_SMOB (Pitch, pp, 1);
Pitch *p = unsmob_pitch (pp);
int q = p->get_octave ();
return scm_from_int (q);
1, 0, 0, (SCM pp),
"Extract the alteration from pitch @var{p}.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, pp);
+ LY_ASSERT_SMOB (Pitch, pp, 1);
Pitch *p = unsmob_pitch (pp);
Rational q = p->get_alteration ();
1, 0, 0, (SCM pp),
"Extract the note name from pitch @var{pp}.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, pp);
+ LY_ASSERT_SMOB (Pitch, pp, 1);
Pitch *p = unsmob_pitch (pp);
int q = p->get_notename ();
return scm_from_int (q);
1, 0, 0, (SCM pp),
"Calculate the number of quarter tones of @var{p} from middle C.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, pp);
+ LY_ASSERT_SMOB (Pitch, pp, 1);
Pitch *p = unsmob_pitch (pp);
int q = p->rounded_quartertone_pitch ();
return scm_from_int (q);
1, 0, 0, (SCM pp),
"calculate the number of semitones of @var{p} from middle C.")
{
- LY_ASSERT_FIRST_SMOB (Pitch, pp);
+ LY_ASSERT_SMOB (Pitch, pp, 1);
Pitch *p = unsmob_pitch (pp);
int q = p->rounded_semitone_pitch ();
return scm_from_int (q);
2, 0, 0, (SCM p1, SCM p2),
"Is @var{p1} lexicographically smaller than @var{p2}?")
{
- LY_ASSERT_FIRST_SMOB (Pitch, p1);
- LY_ASSERT_SMOB (Pitch, 2);
+ LY_ASSERT_SMOB (Pitch, p1, 1);
+ LY_ASSERT_SMOB (Pitch, p2, 2);
Pitch *a = unsmob_pitch (p1);
Pitch *b = unsmob_pitch (p2);
"@var{delta} equals @var{root}")
{
- LY_ASSERT_FIRST_SMOB (Pitch, pitch);
- LY_ASSERT_SMOB (Pitch, 2);
+ LY_ASSERT_SMOB (Pitch, pitch, 1);
+ LY_ASSERT_SMOB (Pitch, root, 2);
Pitch *p = unsmob_pitch (pitch);
Pitch *r = unsmob_pitch (root);
2, 1, 0, (SCM obj, SCM sym, SCM value),
"Set property @var{sym} of @var{obj} to @var{value}")
{
- LY_ASSERT_FIRST_SMOB (Prob, obj);
+ LY_ASSERT_SMOB (Prob, obj, 1);
Prob *ps = unsmob_prob (obj);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
ps->set_property (sym, value);
return SCM_UNSPECIFIED;
2, 1, 0, (SCM obj, SCM sym, SCM dfault),
"Return the value for @var{sym}.")
{
- LY_ASSERT_FIRST_SMOB (Prob, obj);
+ LY_ASSERT_SMOB (Prob, obj, 1);
Prob *ps = unsmob_prob (obj);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_TYPE (ly_is_symbol,sym, 2);
if (dfault == SCM_UNDEFINED)
dfault = SCM_EOL;
{
option_hash = scm_permanent_object (scm_c_make_hash_table (11));
}
- LY_ASSERT_FIRST_TYPE (ly_is_symbol, sym);
- LY_ASSERT_TYPE (scm_is_string, 3);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 1);
+ LY_ASSERT_TYPE (scm_is_string, description, 3);
internal_set_option (sym, val);
LY_DEFINE (ly_set_option, "ly:set-option", 1, 1, 0, (SCM var, SCM val),
"Set a program option.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_symbol, var);
+ LY_ASSERT_TYPE (ly_is_symbol, var, 1);
if (val == SCM_UNDEFINED)
val = SCM_BOOL_T;
LY_DEFINE (ly_get_option, "ly:get-option", 1, 0, 0, (SCM var),
"Get a global option setting.")
{
- LY_ASSERT_FIRST_TYPE(ly_is_symbol, var);
+ LY_ASSERT_TYPE (ly_is_symbol, var, 1);
return scm_hashq_ref (option_hash, var, SCM_BOOL_F);
}
1, 0, 0, (SCM scale),
"Set the global default scale.")
{
- LY_ASSERT_FIRST_SMOB (Scale, scale);
+ LY_ASSERT_SMOB (Scale, scale, 1);
Scale *s = Scale::unsmob (scale);
if (default_global_scale)
"\n"
" @var{callback} should take exactly one argument." )
{
- LY_ASSERT_FIRST_TYPE(ly_is_procedure, callback);
+ LY_ASSERT_TYPE (ly_is_procedure, callback, 1);
Scheme_listener *l = new Scheme_listener (callback);
SCM listener = GET_LISTENER (l->call).smobbed_copy ();
l->unprotect ();
(SCM music),
"Return score with @var{music} encapsulated in @var{score}.")
{
- LY_ASSERT_FIRST_SMOB (Music, music);
+ LY_ASSERT_SMOB (Music, music, 1);
Music *mus = unsmob_music (music);
Score *score = new Score;
1, 0, 0, (SCM score),
"All output defs in a score.")
{
- LY_ASSERT_FIRST_SMOB (Score, score);
+ LY_ASSERT_SMOB (Score, score, 1);
Score *sc = unsmob_score (score);
SCM l = SCM_EOL;
1, 0, 0, (SCM score),
"return score header.")
{
- LY_ASSERT_FIRST_SMOB (Score, score);
+ LY_ASSERT_SMOB (Score, score, 1);
Score *sc = unsmob_score (score);
return sc->header_;
}
1, 0, 0, (SCM score),
"return score music.")
{
- LY_ASSERT_FIRST_SMOB (Score, score);
+ LY_ASSERT_SMOB (Score, score, 1);
Score *sc = unsmob_score (score);
return sc->get_music ();
}
1, 0, 0, (SCM score),
"Was there an error in the score?")
{
- LY_ASSERT_FIRST_SMOB (Score, score);
+ LY_ASSERT_SMOB (Score, score, 1);
Score *sc = unsmob_score (score);
return scm_from_bool (sc->error_found_);
}
"return a list of layout-lines. "
"\nTake optional Object_key argument.")
{
- LY_ASSERT_FIRST_SMOB (Score, score);
- LY_ASSERT_SMOB (Output_def, 2);
+ LY_ASSERT_SMOB (Score, score, 1);
+ LY_ASSERT_SMOB (Output_def, layout, 2);
Score *sc = unsmob_score (score);
Output_def *od = unsmob_output_def (layout);
"negative for compressing and #f for non-satisfied constraints) "
"followed by the @var{spring-count}+1 positions of the objects. ")
{
- LY_FUNC_NOTE_FIRST_ARG(springs);
-
int len = scm_ilength (springs);
if (len == 0)
return scm_list_2 (scm_from_double (0.0), scm_from_double (0.0));
SCM_ASSERT_TYPE (len >= 0, springs, SCM_ARG1, __FUNCTION__, "list of springs");
SCM_ASSERT_TYPE (scm_ilength (rods) > 0, rods, SCM_ARG1, __FUNCTION__, "list of rods");
- LY_ASSERT_TYPE(scm_is_number, 3);
+ LY_ASSERT_TYPE(scm_is_number, length, 3);
bool is_ragged = ragged == SCM_BOOL_T;
Simple_spacer spacer;
"Get one of the bounds of @var{spanner}. @var{dir} is @code{-1} "
"for left, and @code{1} for right.")
{
- LY_ASSERT_FIRST_TYPE (unsmob_spanner, slur);
- LY_ASSERT_TYPE(is_direction, 2);
+ LY_ASSERT_TYPE (unsmob_spanner, slur, 1);
+ LY_ASSERT_TYPE(is_direction, dir,2);
return unsmob_spanner (slur)->get_bound (to_dir (dir))->self_scm ();
}
1, 0, 0, (SCM spanner),
"Return broken-into list for @var{spanner}.")
{
- SCM_ASSERT_FIRST_TYPE (unsmob_spanner, spanner);
+ LY_ASSERT_TYPE (unsmob_spanner, spanner, 1);
Spanner *me = dynamic_cast<Spanner *> (unsmob_grob (spanner));
SCM s = SCM_EOL;
1, 0, 0, (SCM sg),
"Return the Y-position of @var{sg} relative to the staff.")
{
- LY_ASSERT_FIRST_SMOB (Grob, sg);
+ LY_ASSERT_SMOB (Grob, sg, 1);
Grob *g = unsmob_grob (sg);
Real pos = Staff_symbol_referencer::get_position (g);
"Return a copy of @var{stil} but translated by @var{amount} in @var{axis} direction.")
{
Stencil *s = unsmob_stencil (stil);
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
- LY_ASSERT_TYPE(scm_is_number, 2);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
+ LY_ASSERT_TYPE(scm_is_number,amount, 2);
+ LY_ASSERT_TYPE(is_axis,axis, 3);
Real real_amount = scm_to_double (amount);
-#if 0
- SCM_ASSERT_TYPE (!isinf (real_amount) && !isnan (real_amount),
- amount, SCM_ARG2, __FUNCTION__, "finite number");
-#endif
-
- LY_ASSERT_TYPE(is_axis, 3);
-
SCM new_s = s->smobbed_copy ();
Stencil *q = unsmob_stencil (new_s);
q->translate_axis (real_amount, Axis (scm_to_int (axis)));
"but translated by @var{offset} (a pair of numbers).")
{
Stencil *s = unsmob_stencil (stil);
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
- LY_ASSERT_TYPE(is_number_pair, 2);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
+ LY_ASSERT_TYPE(is_number_pair, offset, 2);
Offset o = ly_scm2offset (offset);
SCM new_s = s->smobbed_copy ();
"Return the expression of @var{stil}.")
{
Stencil *s = unsmob_stencil (stil);
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
return s->expr ();
}
"@var{axis} direction (0 or 1 for x and y axis respectively).")
{
Stencil *s = unsmob_stencil (stil);
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
- LY_ASSERT_TYPE(is_axis, 2);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
+ LY_ASSERT_TYPE(is_axis, axis, 2);
return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
}
"Return whether @var{stil} is empty ")
{
Stencil *s = unsmob_stencil (stil);
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
return scm_from_bool (s->is_empty ());
}
Stencil *s2 = unsmob_stencil (second);
Stencil result;
- LY_FUNC_NOTE_FIRST_ARG(first);
SCM_ASSERT_TYPE (s1 || first == SCM_BOOL_F || first == SCM_EOL,
first, SCM_ARG1, __FUNCTION__, "Stencil, #f or ()");
SCM_ASSERT_TYPE (s2 || second == SCM_BOOL_F || second == SCM_EOL,
second, SCM_ARG4, __FUNCTION__, "Stencil, #f or ()");
- LY_ASSERT_TYPE(is_axis, 2);
- LY_ASSERT_TYPE(is_direction, 3);
+ LY_ASSERT_TYPE(is_axis, axis, 2);
+ LY_ASSERT_TYPE(is_direction, direction, 3);
Real p = 0.0;
if (padding != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_number, 5);
+ LY_ASSERT_TYPE(scm_is_number, padding, 5);
p = scm_to_double (padding);
}
Real m = 0.0;
if (minimum != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(scm_is_number, 6);
+ LY_ASSERT_TYPE(scm_is_number, minimum, 6);
m = scm_to_double (minimum);
}
"If the extents are unspecified, they are taken to be empty."
)
{
- LY_FUNC_NOTE_FIRST_ARG (expr);
SCM_ASSERT_TYPE (!scm_is_pair (expr)
|| is_stencil_head (scm_car (expr)),
expr, SCM_ARG1, __FUNCTION__, "registered stencil expression");
Interval x;
if (xext != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(is_number_pair, 2);
+ LY_ASSERT_TYPE(is_number_pair, xext, 2);
x = ly_scm2interval (xext);
}
Interval y;
if (yext != SCM_UNDEFINED)
{
- LY_ASSERT_TYPE(is_number_pair, 3);
+ LY_ASSERT_TYPE(is_number_pair,yext, 3);
y = ly_scm2interval (yext);
}
"@var{dir} is a number -1, 1 are left and right respectively. "
"Other values are interpolated (so 0 means the center).")
{
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
- LY_ASSERT_TYPE(is_axis, 2);
- LY_ASSERT_TYPE(scm_is_number, 3);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
+ LY_ASSERT_TYPE(is_axis,axis, 2);
+ LY_ASSERT_TYPE(scm_is_number, dir, 3);
Stencil target = *unsmob_stencil (stil);
1, 0, 0, (SCM s),
" Analyse @var{s}, and return a list of fonts used in @var{s}.")
{
- LY_ASSERT_FIRST_SMOB (Stencil, s);
+ LY_ASSERT_SMOB (Stencil, s, 1);
Stencil *stil = unsmob_stencil (s);
return find_expression_fonts (stil->expr ());
}
4, 0, 0, (SCM stc, SCM r, SCM g, SCM b),
"Put @var{stc} in a different color.")
{
- LY_ASSERT_FIRST_SMOB (Stencil, stc);
+ LY_ASSERT_SMOB (Stencil, stc, 1);
Stencil *stil = unsmob_stencil (stc);
return Stencil (stil->extent_box (),
scm_list_3 (ly_symbol2scm ("color"),
4, 0, 0, (SCM expr, SCM func, SCM arg1, SCM offset),
"Parse EXPR, feed bits to FUNC with first arg ARG1")
{
- LY_FUNC_NOTE_FIRST_ARG(expr);
- LY_ASSERT_TYPE (ly_is_procedure, 2);
+ LY_ASSERT_TYPE (ly_is_procedure, func, 2);
Stencil_interpret_arguments a;
a.func = func;
"given by @var{iv}. The wings protude by an amount of @var{p}, which "
"may be negative. The thickness is given by @var{t}.")
{
- LY_ASSERT_FIRST_TYPE(is_axis, a);
- LY_ASSERT_TYPE(is_number_pair, 2);
- LY_ASSERT_TYPE(scm_is_number, 3);
- LY_ASSERT_TYPE(scm_is_number, 4);
+ LY_ASSERT_TYPE (is_axis, a, 1);
+ LY_ASSERT_TYPE(is_number_pair,iv, 2);
+ LY_ASSERT_TYPE(scm_is_number, t,3);
+ LY_ASSERT_TYPE(scm_is_number, p,4);
return Lookup::bracket ((Axis)scm_to_int (a), ly_scm2interval (iv),
scm_to_double (t),
"Return a @var{stil} rotated @var{angle} degrees around point (@var{x}, @var{y}).")
{
Stencil *s = unsmob_stencil (stil);
- LY_ASSERT_FIRST_SMOB(Stencil, stil);
- LY_ASSERT_TYPE(scm_is_number, 2);
- LY_ASSERT_TYPE(scm_is_number, 3);
- LY_ASSERT_TYPE(scm_is_number, 4);
+ LY_ASSERT_SMOB (Stencil, stil, 1);
+ LY_ASSERT_TYPE(scm_is_number,angle, 2);
+ LY_ASSERT_TYPE(scm_is_number, x,3);
+ LY_ASSERT_TYPE(scm_is_number, y, 4);
Real a = scm_to_double (angle);
Real x_off = scm_to_double (x);
Real y_off = scm_to_double (y);
"that prints a black box of dimensions @var{xext}, "
"@var{yext} and roundness @var{blot}.")
{
- LY_ASSERT_FIRST_TYPE(is_number_pair, xext);
- LY_ASSERT_TYPE(is_number_pair, 2);
- LY_ASSERT_TYPE(scm_is_number, 3);
+ LY_ASSERT_TYPE (is_number_pair, xext, 1);
+ LY_ASSERT_TYPE(is_number_pair, yext, 2);
+ LY_ASSERT_TYPE(scm_is_number, blot, 3);
return Lookup::round_filled_box (Box (ly_scm2interval (xext), ly_scm2interval (yext)),
scm_to_double (blot)).smobbed_copy ();
(SCM symbol),
"Add @var{symbol} as head of a stencil expression")
{
- LY_ASSERT_FIRST_TYPE(ly_is_symbol, symbol);
+ LY_ASSERT_TYPE (ly_is_symbol, symbol, 1);
register_stencil_head (symbol);
return SCM_UNSPECIFIED;
}
1, 1, 0, (SCM cl, SCM proplist),
"Creates a stream event of class @var{cl} with the given mutable property list.\n" )
{
- LY_ASSERT_FIRST_TYPE (ly_is_symbol, cl);
+ LY_ASSERT_TYPE (ly_is_symbol, cl, 1);
/* should be scm_list_p, but scm_list_p is expensive. */
- LY_ASSERT_TYPE(scm_is_pair, 2);
+ LY_ASSERT_TYPE(scm_is_pair, proplist, 2);
if (proplist == SCM_UNDEFINED)
proplist = SCM_EOL;
"Get the property @var{sym} of stream event @var{mus}.\n"
"If @var{sym} is undefined, return @code{'()}.\n")
{
- LY_ASSERT_FIRST_SMOB (Stream_event, sev);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Stream_event, sev, 1);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
Stream_event *e = unsmob_stream_event (sev);
3, 0, 0, (SCM ev, SCM sym, SCM val),
"Set property @var{sym} in event @var{ev} to @var{val}.")
{
- LY_ASSERT_FIRST_SMOB (Stream_event, ev);
- LY_ASSERT_TYPE (ly_is_symbol, 2);
+ LY_ASSERT_SMOB (Stream_event, ev, 1);
+ LY_ASSERT_TYPE (ly_is_symbol, sym, 2);
return ly_prob_set_property_x (ev, sym, val);
}
SCM props,
SCM markup)
{
- LY_ASSERT_FIRST_SMOB (Output_def, layout_smob);
- LY_ASSERT_TYPE (scm_is_string, 3);
+ LY_ASSERT_SMOB (Output_def, layout_smob, 1);
+ LY_ASSERT_TYPE (scm_is_string, props, 3);
string str = ly_scm2string (markup);
Output_def *layout = unsmob_output_def (layout_smob);
"Return the type name of the translator object @var{trans}. "
"The name is a symbol.")
{
- LY_ASSERT_FIRST_SMOB (Translator, trans);
+ LY_ASSERT_SMOB (Translator, trans, 1);
Translator *tr = unsmob_translator (trans);
char const *nm = tr->class_name ();
return ly_symbol2scm (nm);
1, 0, 0, (SCM me),
"Return an alist of properties of translator @var{me}.")
{
- LY_ASSERT_FIRST_SMOB (Translator, me);
+ LY_ASSERT_SMOB (Translator, me, 1);
Translator *tr = unsmob_translator (me);
return tr->translator_description ();
}
1, 0, 0, (SCM ttf_file_name),
"Extract the PostScript name from a TrueType font.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, ttf_file_name);
+ LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
string file_name = ly_scm2string (ttf_file_name);
if (be_verbose_global)
progress_indication ("[" + file_name);
"Convert the contents of a TTF file to Type42 PFA, returning it as "
" a string.")
{
- LY_ASSERT_FIRST_TYPE(scm_is_string, ttf_file_name);
+ LY_ASSERT_TYPE (scm_is_string, ttf_file_name, 1);
string file_name = ly_scm2string (ttf_file_name);
if (be_verbose_global)