From: Han-Wen Nienhuys Date: Wed, 1 Sep 2004 19:41:17 +0000 (+0000) Subject: * lily/include/lily-guile.hh: compatibility glue for 1.6 X-Git-Tag: release/2.3.14~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=1d1f85702652995fe2531ed26a2db8756fb3b4ee;p=lilypond.git * lily/include/lily-guile.hh: compatibility glue for 1.6 * lily/lily-guile.cc: remove ly_scm2str0. --- diff --git a/ChangeLog b/ChangeLog index d941200f38..2cec1be1c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-09-01 Han-Wen Nienhuys + * lily/include/lily-guile.hh: compatibility glue for 1.6 + + * lily/*.cc (acknowledge_grob): ly_string_p -> scm_is_string. + * lily/lily-guile.cc: remove ly_scm2str0. 2004-09-01 Jan Nieuwenhuizen diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index 52c4bccae2..04afa13be6 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -211,7 +211,7 @@ LY_DEFINE (ly_font_load, "ly:font-load", 1, 0, 0, (SCM name), "Load the font @var{name}. ") { - SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name)); diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index fda74a0cf0..d60fdb76a6 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -75,7 +75,7 @@ private: void Auto_beam_engraver::process_music () { - if (ly_c_string_p (get_property ("whichBar"))) + if (scm_is_string (get_property ("whichBar"))) { consider_end (shortest_mom_); junk_beam (); diff --git a/lily/bar-engraver.cc b/lily/bar-engraver.cc index e62d814c96..379b2394e1 100644 --- a/lily/bar-engraver.cc +++ b/lily/bar-engraver.cc @@ -75,7 +75,7 @@ Bar_engraver::finalize () void Bar_engraver::process_acknowledged_grobs () { - if (!bar_ && ly_c_string_p (get_property ("whichBar"))) + if (!bar_ && scm_is_string (get_property ("whichBar"))) create_bar (); } diff --git a/lily/bar-line.cc b/lily/bar-line.cc index 6d0b04dca5..832ab1af32 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -30,7 +30,7 @@ Bar_line::print (SCM smob) SCM s = me->get_property ("glyph"); SCM barsiz_proc = me->get_property ("bar-size-procedure"); - if (ly_c_string_p (s) && ly_c_procedure_p (barsiz_proc)) + if (scm_is_string (s) && ly_c_procedure_p (barsiz_proc)) { String str =ly_scm2string (s); SCM siz = scm_call_1 (barsiz_proc, me->self_scm ()); @@ -166,13 +166,13 @@ Bar_line::before_line_breaking (SCM smob) SCM g = me->get_property ("glyph"); SCM orig = g; Direction bsd = item->break_status_dir (); - if (ly_c_string_p (g) && bsd) + if (scm_is_string (g) && bsd) { SCM proc = me->get_property ("break-glyph-function"); g = scm_call_2 (proc, g, scm_int2num (bsd)); } - if (!ly_c_string_p (g)) + if (!scm_is_string (g)) { me->set_property ("print-function", SCM_EOL); me->set_extent (SCM_EOL, X_AXIS); diff --git a/lily/bar-number-engraver.cc b/lily/bar-number-engraver.cc index 7ba942a3b3..7d0550c9c6 100644 --- a/lily/bar-number-engraver.cc +++ b/lily/bar-number-engraver.cc @@ -45,7 +45,7 @@ Bar_number_engraver::process_music () SCM wb = get_property ("whichBar"); - if (ly_c_string_p (wb)) + if (scm_is_string (wb)) { SCM smp = get_property ("measurePosition"); diff --git a/lily/beam.cc b/lily/beam.cc index 7539ce8907..3a63c6df4a 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -509,7 +509,7 @@ Beam::print (SCM grob) #if (DEBUG_QUANTING) SCM quant_score = me->get_property ("quant-score"); if (to_boolean (me->get_paper ()->lookup_variable (ly_symbol2scm ("debug-beam-quanting"))) - && ly_c_string_p (quant_score)) + && scm_is_string (quant_score)) { /* diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 7ae0c0bd25..11f1554bca 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -76,7 +76,7 @@ Clef_engraver::acknowledge_grob (Grob_info info) if (item) { if (Bar_line::has_interface (info.grob_) - && ly_c_string_p (get_property ("clefGlyph"))) + && scm_is_string (get_property ("clefGlyph"))) create_clef (); } } diff --git a/lily/clef.cc b/lily/clef.cc index 7774d1920e..c7e4920a99 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -23,7 +23,7 @@ Clef::before_line_breaking (SCM smob) SCM glyph = s->get_property ("glyph-name"); - if (ly_c_string_p (glyph)) + if (scm_is_string (glyph)) { String str = ly_scm2string (glyph); @@ -53,7 +53,7 @@ Clef::print (SCM smob) { Grob *me = unsmob_grob (smob); SCM glyph_scm = me->get_property ("glyph-name"); - if (!ly_c_string_p (glyph_scm)) + if (!scm_is_string (glyph_scm)) return SCM_EOL; String glyph = String (ly_scm2string (glyph_scm)); diff --git a/lily/context-def.cc b/lily/context-def.cc index 797eb172b7..5ad0911229 100644 --- a/lily/context-def.cc +++ b/lily/context-def.cc @@ -100,7 +100,7 @@ Context_def::add_context_mod (SCM mod) } SCM sym = ly_cadr (mod); - if (ly_c_string_p (sym)) + if (scm_is_string (sym)) sym = scm_string_to_symbol (sym); if (ly_symbol2scm ("consists") == tag @@ -213,7 +213,7 @@ Context_def::get_translator_names (SCM user_mod) const SCM tag = ly_caar (s); SCM arg = ly_cadar (s); - if (ly_c_string_p (arg)) + if (scm_is_string (arg)) arg = scm_string_to_symbol (arg); if (ly_symbol2scm ("consists") == tag) diff --git a/lily/context-specced-music-iterator.cc b/lily/context-specced-music-iterator.cc index fb5968b980..6583f3c6fd 100644 --- a/lily/context-specced-music-iterator.cc +++ b/lily/context-specced-music-iterator.cc @@ -25,7 +25,7 @@ Context_specced_music_iterator::construct_children () String c_id; SCM ci = get_music ()->get_property ("context-id"); - if (ly_c_string_p (ci)) + if (scm_is_string (ci)) c_id = ly_scm2string (ci); SCM ops = get_music ()->get_property ("property-operations"); diff --git a/lily/custos-engraver.cc b/lily/custos-engraver.cc index 40b2941c07..0538aef452 100644 --- a/lily/custos-engraver.cc +++ b/lily/custos-engraver.cc @@ -93,7 +93,7 @@ Custos_engraver::acknowledge_grob (Grob_info info) void Custos_engraver::process_acknowledged_grobs () { - if (ly_c_string_p (get_property ("whichBar"))) + if (scm_is_string (get_property ("whichBar"))) custos_permitted = true; if (custos_permitted) diff --git a/lily/drum-note-engraver.cc b/lily/drum-note-engraver.cc index e26cdceebf..884f6c4de6 100644 --- a/lily/drum-note-engraver.cc +++ b/lily/drum-note-engraver.cc @@ -101,7 +101,7 @@ Drum_notes_engraver::process_music () if (ly_c_symbol_p (style)) note->set_property ("style", style); - if (ly_c_string_p (script)) + if (scm_is_string (script)) { Item *p = make_item ("Script", ev->self_scm ()); bool follow; diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index a6d82e9785..bb888f21d3 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -248,7 +248,7 @@ Dynamic_engraver::process_music () /* FIXME: use get_markup () to check type. */ - if (ly_c_string_p (s) || ly_c_pair_p (s)) + if (scm_is_string (s) || ly_c_pair_p (s)) { cresc_->set_property ("edge-text", scm_cons (s, scm_makfrom0str (""))); diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index 257708de29..e8e2bab12a 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -75,10 +75,10 @@ Dynamic_performer::create_audio_elements () */ SCM s = get_property ("midiInstrument"); - if (!ly_c_string_p (s)) + if (!scm_is_string (s)) s = get_property ("instrument"); - if (!ly_c_string_p (s)) + if (!scm_is_string (s)) s = scm_makfrom0str ("piano"); diff --git a/lily/font-metric.cc b/lily/font-metric.cc index 6c61e77fb3..7bf1f39796 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -139,7 +139,7 @@ LY_DEFINE (ly_find_glyph_by_name, "ly:find-glyph-by-name", { Font_metric *fm = unsmob_metrics (font); SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG2, __FUNCTION__, "string"); Stencil m = fm->find_by_name (ly_scm2string (name)); @@ -171,7 +171,7 @@ LY_DEFINE (ly_text_dimension,"ly:text-dimension", Modified_font_metric*fm = dynamic_cast (unsmob_metrics (font)); SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "modified font metric"); - SCM_ASSERT_TYPE (ly_c_string_p (text), text, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (text), text, SCM_ARG2, __FUNCTION__, "string"); b = fm->text_dimension (ly_scm2string (text)); diff --git a/lily/font-select.cc b/lily/font-select.cc index f04da901b3..1e5134a24c 100644 --- a/lily/font-select.cc +++ b/lily/font-select.cc @@ -112,7 +112,7 @@ select_encoded_font (Output_def *paper, SCM chain, SCM input_encoding) { SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain); - if (!ly_c_pair_p (name) || !ly_c_string_p (ly_cdr (name))) + if (!ly_c_pair_p (name) || !scm_is_string (ly_cdr (name))) { SCM fonts = paper->lookup_variable (ly_symbol2scm ("fonts")); name = properties_to_font_size_family (fonts, chain); @@ -120,7 +120,7 @@ select_encoded_font (Output_def *paper, SCM chain, SCM input_encoding) else name = ly_cdr (name); - if (ly_c_string_p (name)) + if (scm_is_string (name)) { SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain); Real rmag = (ly_c_pair_p (mag) diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index 5a7e7d0f8d..aaa22f5fb5 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -30,7 +30,7 @@ LY_DEFINE (ly_add_interface, "ly:add-interface", 3,0,0, (SCM a, SCM b, SCM c), "Add an interface description.") { SCM_ASSERT_TYPE (ly_c_symbol_p (a), a, SCM_ARG1, __FUNCTION__, "symbol"); - SCM_ASSERT_TYPE (ly_c_string_p (b), b, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (b), b, SCM_ARG2, __FUNCTION__, "string"); SCM_ASSERT_TYPE (ly_c_list_p (c), c, SCM_ARG3, __FUNCTION__, "list of syms"); if (!ly_c_vector_p (all_ifaces)) all_ifaces = scm_make_vector (scm_int2num (40), SCM_EOL); diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index cd6ea97b87..4576a2271d 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -22,7 +22,10 @@ #define SCM_VECTOR_REF(v,i) (SCM_VELTS ((v))[(i)]) #define scm_from_int(x) SCM_MAKINUM (x) #define scm_is_integer(x) SCM_INUMP (x) +#define scm_is_string(x) SCM_STRINGP(x) #define scm_hash_table_p scm_vector_p +#define scm_i_string_chars(x) SCM_STRING_CHARS(x) +#define scm_i_string_length(x) SCM_STRING_LENGTH(x) #endif /* SCM_MINOR_VERSION < 7 */ #ifndef SMOB_FREE_RETURN_VAL diff --git a/lily/input-smob.cc b/lily/input-smob.cc index 798e61d51a..b5b5097b62 100644 --- a/lily/input-smob.cc +++ b/lily/input-smob.cc @@ -85,7 +85,7 @@ LY_DEFINE (ly_input_message, "ly:input-message", 2, 0, 0, (SCM sip, SCM msg), { Input *ip = unsmob_input (sip); SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location"); - SCM_ASSERT_TYPE (ly_c_string_p (msg), msg, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (msg), msg, SCM_ARG2, __FUNCTION__, "string"); String m = ly_scm2string (msg); ip->message (m); diff --git a/lily/instrument-name-engraver.cc b/lily/instrument-name-engraver.cc index 0de40cf688..334da9dd59 100644 --- a/lily/instrument-name-engraver.cc +++ b/lily/instrument-name-engraver.cc @@ -121,7 +121,7 @@ Instrument_name_engraver::process_music () Also create text if barlines in other groups. This allows a name to be attached to lyrics or chords. */ - if (ly_c_string_p (get_property ("whichBar"))) + if (scm_is_string (get_property ("whichBar"))) create_text (); } diff --git a/lily/kpath.cc b/lily/kpath.cc index 4eae83af49..1a4886f72d 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -154,7 +154,7 @@ LY_DEFINE (ly_kpathsea_expand_path, "ly:kpathsea-expand-path", "Return the expanded path of @var{name}, or" "@code{#f} if not found.") { - SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); String nm = ly_scm2string (name); String filename = global_path.find (nm); diff --git a/lily/lexer.ll b/lily/lexer.ll index 6ec3cf94b9..43b10a51de 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -257,7 +257,7 @@ HYPHEN -- s = s.left_string (s.length () - 1); SCM sid = lookup_identifier (s); - if (ly_c_string_p (sid)) { + if (scm_is_string (sid)) { new_input (ly_scm2string (sid), sources_); yy_pop_state (); } else { diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index fb4903b710..948d546f46 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -110,7 +110,7 @@ LY_DEFINE (ly_gulp_file, "ly:gulp-file", "Read the file @var{name}, and return its contents in a string. " "The file is looked up using the search path.") { - SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); return scm_makfrom0str (gulp_file_to_string (ly_scm2string (name)).to_str0 ()); } @@ -135,7 +135,7 @@ ly_scm2string (SCM str) char * ly_scm2newstr (SCM str, size_t *lenp) { - SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string"); size_t len = SCM_STRING_LENGTH (str); if (char *new_str = (char *) malloc ((len + 1) * sizeof (char))) @@ -174,7 +174,7 @@ LY_DEFINE (ly_warn, "ly:warn", "Scheme callable function to issue the warning @code{msg}. " "The message is formatted with @code{format} and @code{rest}.") { - SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string"); progress_indication ("\n"); str = scm_simple_format (SCM_BOOL_F, str, rest); @@ -187,7 +187,7 @@ LY_DEFINE (ly_programming_error, "ly:programming-error", "Scheme callable function to issue the warning @code{msg}. " "The message is formatted with @code{format} and @code{rest}.") { - SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "string"); progress_indication ("\n"); str = scm_simple_format (SCM_BOOL_F, str, rest); @@ -806,7 +806,7 @@ LY_DEFINE (ly_pango_add_afm_decoder, "ly:pango-add-afm-decoder", 1, 0, 0, (SCM font_family), "Add pango afm decoder for FONT-FAMILY.") { - SCM_ASSERT_TYPE (ly_c_string_p (font_family), font_family, SCM_ARG1, + SCM_ASSERT_TYPE (scm_is_string (font_family), font_family, SCM_ARG1, __FUNCTION__, "font_family"); pango_fc_afm_add_decoder (ly_scm2newstr (font_family, 0)); return SCM_UNSPECIFIED; @@ -818,7 +818,7 @@ LY_DEFINE (ly_gettext, "ly:gettext", 1, 0, 0, (SCM string), "Gettext wrapper.") { - SCM_ASSERT_TYPE (ly_c_string_p (string), string, SCM_ARG1, + SCM_ASSERT_TYPE (scm_is_string (string), string, SCM_ARG1, __FUNCTION__, "string"); return scm_makfrom0str (gettext (scm_i_string_chars (string))); } diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index 9226c5440a..3bb157d5fd 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -209,7 +209,7 @@ void Lily_lexer::set_identifier (SCM name, SCM s) { SCM sym = name; - if (ly_c_string_p (name)) + if (scm_is_string (name)) sym = scm_string_to_symbol (name); if (ly_c_symbol_p (sym)) diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 818ae67289..3183421f39 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -256,7 +256,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", "Parse a single @code{.ly} file. " "Upon failure, throw @code{ly-file-failed} key.") { - SCM_ASSERT_TYPE (ly_c_string_p (name), name, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string"); char const *file = scm_i_string_chars (name); char const *extensions[] = {"ly", "", 0}; @@ -326,7 +326,7 @@ LY_DEFINE (ly_parse_string, "ly:parse-string", "Parse the string LY_CODE. " "Upon failure, throw @code{ly-file-failed} key.") { - SCM_ASSERT_TYPE (ly_c_string_p (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG1, __FUNCTION__, "string"); Sources sources; sources.set_path (&global_path); @@ -388,7 +388,7 @@ LY_DEFINE (ly_parser_parse_string, "ly:parser-parse-string", Lily_parser *parser = unsmob_my_lily_parser (parser_smob); SCM_ASSERT_TYPE (parser, parser_smob, SCM_ARG1, __FUNCTION__, "parser"); - SCM_ASSERT_TYPE (ly_c_string_p (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (ly_code), ly_code, SCM_ARG2, __FUNCTION__, "string"); parser->parse_string (ly_scm2string (ly_code)); diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index e82aa698c2..ed0bab66fc 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -71,7 +71,7 @@ get_voice_to_lyrics (Context *lyrics) SCM voice_name = lyrics->get_property ("associatedVoice"); String nm = lyrics->id_string (); - if (ly_c_string_p (voice_name)) + if (scm_is_string (voice_name)) nm = ly_scm2string (voice_name); else { diff --git a/lily/lyric-performer.cc b/lily/lyric-performer.cc index 09a38f40b0..9542f222ec 100644 --- a/lily/lyric-performer.cc +++ b/lily/lyric-performer.cc @@ -40,7 +40,7 @@ Lyric_performer::create_audio_elements () { // FIXME: won't work with fancy lyrics if (lreqs_.size () - && ly_c_string_p (lreqs_[0]->get_property ("text")) + && scm_is_string (lreqs_[0]->get_property ("text")) && ly_scm2string (lreqs_[0]->get_property ("text")).length ()) { audio_ = new Audio_text (Audio_text::LYRIC, diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index 2b67671b2d..6bb485fa96 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -113,7 +113,7 @@ Modified_font_metric::make_scaled_font_metric (SCM coding, if (ly_c_symbol_p (coding)) coding = scm_symbol_to_string (coding); - String scheme = ly_c_string_p (coding) ? ly_scm2string (coding) : ""; + String scheme = scm_is_string (coding) ? ly_scm2string (coding) : ""; Modified_font_metric *sfm = new Modified_font_metric (scheme, m, s); diff --git a/lily/multi-measure-rest-engraver.cc b/lily/multi-measure-rest-engraver.cc index 33a9cfb24b..2b36fb408f 100644 --- a/lily/multi-measure-rest-engraver.cc +++ b/lily/multi-measure-rest-engraver.cc @@ -133,7 +133,7 @@ Multi_measure_rest_engraver::process_music () = ly_scm2int (get_property ("currentBarNumber")); } - bar_seen_ = ly_c_string_p (get_property ("whichBar")); + bar_seen_ = scm_is_string (get_property ("whichBar")); } void diff --git a/lily/music.cc b/lily/music.cc index 161bf21ab7..ea81bb0df6 100644 --- a/lily/music.cc +++ b/lily/music.cc @@ -130,7 +130,7 @@ Music::print_smob (SCM s, SCM p, scm_print_state*) Music* m = unsmob_music (s); SCM nm = m->get_property ("name"); - if (ly_c_symbol_p (nm) || ly_c_string_p (nm)) + if (ly_c_symbol_p (nm) || scm_is_string (nm)) scm_display (nm, p); else scm_puts (classname (m),p); @@ -294,7 +294,7 @@ LY_DEFINE (ly_extended_make_music, "ly:make-bare-music", "for creating music objects. " ) { - SCM_ASSERT_TYPE (ly_c_string_p (type), type, SCM_ARG1, __FUNCTION__, "string"); + SCM_ASSERT_TYPE (scm_is_string (type), type, SCM_ARG1, __FUNCTION__, "string"); SCM s = make_music (ly_scm2string (type))->self_scm (); unsmob_music (s)->immutable_property_alist_ = props; scm_gc_unprotect_object (s); diff --git a/lily/new-lyric-combine-music-iterator.cc b/lily/new-lyric-combine-music-iterator.cc index 5af6fb4c6a..dd2f487bdb 100644 --- a/lily/new-lyric-combine-music-iterator.cc +++ b/lily/new-lyric-combine-music-iterator.cc @@ -165,10 +165,10 @@ New_lyric_combine_music_iterator::find_voice () SCM voice_name = lyricsto_voice_name_; SCM running = lyrics_context_ ? lyrics_context_->get_property ("associatedVoice") : SCM_EOL; - if (ly_c_string_p (running)) + if (scm_is_string (running)) voice_name = running; - if (ly_c_string_p (voice_name) + if (scm_is_string (voice_name) && (!music_context_ || ly_scm2string (voice_name) != music_context_->id_string ())) { /* @@ -239,7 +239,7 @@ New_lyric_combine_music_iterator::do_quit () SCM voice_name = get_music ()->get_property ("associated-context"); String name; - if (ly_c_string_p (voice_name)) + if (scm_is_string (voice_name)) name = ly_scm2string (voice_name); get_music ()->origin ()->warning (_f ("cannot find Voice `%s'", diff --git a/lily/ottava-engraver.cc b/lily/ottava-engraver.cc index 49c2b56015..99fbe7e3c6 100644 --- a/lily/ottava-engraver.cc +++ b/lily/ottava-engraver.cc @@ -46,7 +46,7 @@ Ottava_spanner_engraver::process_music () { finished_= span_; span_ = 0; - if (ly_c_string_p (ott)) + if (scm_is_string (ott)) { span_ = make_spanner ("OttavaBracket", SCM_EOL); span_->set_property ("text", ott); diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 38faae2fff..5fac3f2cd9 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -137,7 +137,7 @@ LY_DEFINE (ly_outputter_dump_string, "ly:outputter-dump-string", { Paper_outputter *po = unsmob_outputter (outputter); SCM_ASSERT_TYPE (po, outputter, SCM_ARG1, __FUNCTION__, "Paper_outputter"); - SCM_ASSERT_TYPE (ly_c_string_p (str), str, SCM_ARG1, __FUNCTION__, "Paper_outputter"); + SCM_ASSERT_TYPE (scm_is_string (str), str, SCM_ARG1, __FUNCTION__, "Paper_outputter"); return po->dump_string (str); } diff --git a/lily/parser.yy b/lily/parser.yy index ea56d48e60..6b00ad61fd 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1200,7 +1200,7 @@ re_rhythmed_music: /* FIXME: should find out uniqueXXX name from music */ SCM name = $1->get_property ("context-id"); //if (name == SCM_EOL) - if (!ly_c_string_p (name)) + if (!scm_is_string (name)) name = scm_makfrom0str (""); SCM context = scm_makfrom0str ("Lyrics"); @@ -1786,7 +1786,7 @@ direction_reqd_event: | script_abbreviation { SCM s = THIS->lexer_->lookup_identifier ("dash" + ly_scm2string ($1)); Music *a = MY_MAKE_MUSIC ("ArticulationEvent"); - if (ly_c_string_p (s)) + if (scm_is_string (s)) a->set_property ("articulation-type", s); else THIS->parser_error (_ ("Expecting string as script definition")); $$ = a; @@ -2559,7 +2559,7 @@ otherwise, we have to import music classes into the lexer. int Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) { - if (ly_c_string_p (sid)) { + if (scm_is_string (sid)) { *destination = sid; return STRING_IDENTIFIER; } else if (ly_c_number_p (sid)) { @@ -2665,7 +2665,7 @@ context_spec_music (SCM type, SCM id, Music *m, SCM ops) ly_c_symbol_p (type) ? type : scm_string_to_symbol (type)); csm->set_property ("property-operations", ops); - if (ly_c_string_p (id)) + if (scm_is_string (id)) csm->set_property ("context-id", id); return csm; } diff --git a/lily/pfb.cc b/lily/pfb.cc index 60dde35569..9dbdf0f363 100644 --- a/lily/pfb.cc +++ b/lily/pfb.cc @@ -74,7 +74,7 @@ LY_DEFINE(ly_pfb_to_pfa, "ly:pfb->pfa", "Convert the contents of a PFB file to PFA." ) { - SCM_ASSERT_TYPE(ly_c_string_p (pfb_path), pfb_path, + SCM_ASSERT_TYPE(scm_is_string (pfb_path), pfb_path, SCM_ARG1, __FUNCTION__, "string"); String path = ly_scm2string (pfb_path); diff --git a/lily/piano-pedal-engraver.cc b/lily/piano-pedal-engraver.cc index ad6741cdb2..0ff11c4b58 100644 --- a/lily/piano-pedal-engraver.cc +++ b/lily/piano-pedal-engraver.cc @@ -290,7 +290,7 @@ Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed) } } - if (ly_c_string_p (s)) + if (scm_is_string (s)) { String propname = String (p->name_) + "Pedal"; diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index dc302eca5e..b70abed220 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -101,9 +101,9 @@ Repeat_acknowledge_engraver::process_music () */ SCM wb = get_property ("whichBar"); SCM db = get_property ("defaultBarType"); - if (!ly_c_string_p (wb) || ly_c_equal_p (db, wb)) + if (!scm_is_string (wb) || ly_c_equal_p (db, wb)) { - if (s != "" || (volta_found && !ly_c_string_p (wb))) + if (s != "" || (volta_found && !scm_is_string (wb))) { context ()->set_property ("whichBar", scm_makfrom0str (s.to_str0 ())); } diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 6feb5be1f2..881ff8958f 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -104,7 +104,7 @@ Score_engraver::initialize () + "\n" +_ ("Music font has not been installed properly. Aborting")); SCM pfa_path = ly_kpathsea_expand_path (scm_makfrom0str ("ecrm10.pfa")); - if (!ly_c_string_p (pfa_path)) + if (!scm_is_string (pfa_path)) error (_f ("can't find `%s'", "ecrm10.pfa") + "\n" +_f ("Install the ec-mftraced package from %s. Aborting", "http://lilypond.org/download/fonts/")); diff --git a/lily/score.cc b/lily/score.cc index 9964818760..774cdba07c 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -146,7 +146,7 @@ LY_DEFINE (ly_format_output, "ly:format-output", { Global_context *g = dynamic_cast (unsmob_context (context)); SCM_ASSERT_TYPE (g, context, SCM_ARG1, __FUNCTION__, "Global context"); - SCM_ASSERT_TYPE (ly_c_string_p (outname), outname, SCM_ARG2, __FUNCTION__, "output filename"); + SCM_ASSERT_TYPE (scm_is_string (outname), outname, SCM_ARG2, __FUNCTION__, "output filename"); Music_output *output = g->get_output (); progress_indication ("\n"); diff --git a/lily/slur.cc b/lily/slur.cc index b61522b711..623a239714 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -82,7 +82,7 @@ Slur::print (SCM smob) if (to_boolean (me->get_paper () ->lookup_variable (ly_symbol2scm ("debug-slur-quanting"))) - && ly_c_string_p (quant_score)) + && scm_is_string (quant_score)) { String str; SCM properties = Font_interface::text_font_alist_chain (me); diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 8e87dc0530..97c757c82b 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -65,7 +65,7 @@ Span_bar::print (SCM smobbed_me) /* glyph may not be a string, when ME is killed by Hara Kiri in between. */ - if (!ly_c_string_p (glyph)) + if (!scm_is_string (glyph)) return SCM_EOL; String glyph_string = ly_scm2string (glyph); @@ -179,17 +179,17 @@ Span_bar::evaluate_glyph (Grob*me) { SCM gl = me->get_property ("glyph"); - if (ly_c_string_p (gl)) + if (scm_is_string (gl)) return ; for (SCM s = me->get_property ("elements"); - !ly_c_string_p (gl) && ly_c_pair_p (s); s = ly_cdr (s)) + !scm_is_string (gl) && ly_c_pair_p (s); s = ly_cdr (s)) { gl = unsmob_grob (ly_car (s)) ->get_property ("glyph"); } - if (!ly_c_string_p (gl)) + if (!scm_is_string (gl)) { me->suicide (); return; diff --git a/lily/staff-performer.cc b/lily/staff-performer.cc index 7cb78b5380..6a028a6f67 100644 --- a/lily/staff-performer.cc +++ b/lily/staff-performer.cc @@ -130,7 +130,7 @@ Staff_performer::new_instrument_string () // mustn't ask Score for instrument: it will return piano! SCM minstr = get_property ("midiInstrument"); - if (!ly_c_string_p (minstr) + if (!scm_is_string (minstr) || ly_scm2string (minstr) == instrument_string_) return ""; diff --git a/lily/staff-spacing.cc b/lily/staff-spacing.cc index cd2827297d..c8684e791a 100644 --- a/lily/staff-spacing.cc +++ b/lily/staff-spacing.cc @@ -101,7 +101,7 @@ Staff_spacing::bar_y_positions (Grob *bar_grob) { SCM glyph = bar_grob->get_property ("glyph"); - String glyph_string = ly_c_string_p (glyph) ? ly_scm2string (glyph) : ""; + String glyph_string = scm_is_string (glyph) ? ly_scm2string (glyph) : ""; if (glyph_string.left_string (1) == "|" || glyph_string.left_string (1) == ".") { SCM sz = Bar_line::get_staff_bar_size (bar_grob->self_scm ()); diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 8904bdd712..06751e1a40 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -45,7 +45,7 @@ Stanza_number_engraver::process_music () { SCM stanza = get_property ("stanza"); - if (ly_c_string_p (stanza) && stanza != last_stanza_) + if (scm_is_string (stanza) && stanza != last_stanza_) { last_stanza_ = stanza; diff --git a/lily/stem.cc b/lily/stem.cc index 060e1255f6..7b547f0cda 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -575,7 +575,7 @@ Stem::flag (Grob *me) me->warning (_f ("flag `%s' not found", font_char)); SCM stroke_style_scm = me->get_property ("stroke-style"); - if (ly_c_string_p (stroke_style_scm)) + if (scm_is_string (stroke_style_scm)) { String stroke_style = ly_scm2string (stroke_style_scm); if (!stroke_style.is_empty ()) diff --git a/lily/sustain-pedal.cc b/lily/sustain-pedal.cc index f57ba09a9e..1b2fe25260 100644 --- a/lily/sustain-pedal.cc +++ b/lily/sustain-pedal.cc @@ -42,7 +42,7 @@ Sustain_pedal::print (SCM smob) Stencil mol; SCM glyph = e->get_property ("text"); - if (!ly_c_string_p (glyph)) + if (!scm_is_string (glyph)) return mol.smobbed_copy (); String text = ly_scm2string (glyph); diff --git a/lily/system-start-delimiter-engraver.cc b/lily/system-start-delimiter-engraver.cc index 719a5ed17d..158d201330 100644 --- a/lily/system-start-delimiter-engraver.cc +++ b/lily/system-start-delimiter-engraver.cc @@ -48,11 +48,11 @@ System_start_delimiter_engraver::acknowledge_grob (Grob_info inf) /* UGH UGH */ - if (ly_c_string_p (gl) && ly_c_equal_p (gl, scm_makfrom0str ("brace")) - && ly_c_string_p (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket"))) + if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str ("brace")) + && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket"))) inf.grob_->translate_axis (-0.8, X_AXIS); // ugh - else if (ly_c_string_p (gl) && ly_c_equal_p (gl, scm_makfrom0str ("bracket")) - && ly_c_string_p (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket"))) + else if (scm_is_string (gl) && ly_c_equal_p (gl, scm_makfrom0str ("bracket")) + && scm_is_string (my_gl) && ly_c_equal_p (my_gl, scm_makfrom0str ("bracket"))) { inf.grob_->translate_axis ( -0.8, X_AXIS); // ugh inf.grob_->set_property ("arch-height", diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index aec3166bb4..2aa3da9d4c 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -112,7 +112,7 @@ System_start_delimiter::print (SCM smob) return SCM_EOL; SCM s = me->get_property ("glyph"); - if (!ly_c_string_p (s)) + if (!scm_is_string (s)) return SCM_EOL; SCM gsym = scm_string_to_symbol (s) ; diff --git a/lily/text-item.cc b/lily/text-item.cc index 1226c8e3b3..66c1b6d83a 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -27,7 +27,7 @@ Text_item::interpret_string (SCM paper_smob, SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1, __FUNCTION__, "Paper definition"); - SCM_ASSERT_TYPE (ly_c_string_p (markup), markup, SCM_ARG3, + SCM_ASSERT_TYPE (scm_is_string (markup), markup, SCM_ARG3, __FUNCTION__, "string"); SCM_ASSERT_TYPE (input_encoding == SCM_EOL || ly_c_symbol_p (input_encoding), input_encoding, SCM_ARG2, __FUNCTION__, "symbol"); @@ -36,7 +36,7 @@ Text_item::interpret_string (SCM paper_smob, if (!ly_c_symbol_p (input_encoding)) { SCM enc = paper->lookup_variable (ly_symbol2scm ("inputencoding")); - if (ly_c_string_p (enc)) + if (scm_is_string (enc)) input_encoding = scm_string_to_symbol (enc); else if (ly_c_symbol_p (enc)) input_encoding = enc; @@ -69,7 +69,7 @@ MAKE_SCHEME_CALLBACK (Text_item, interpret_markup, 3) SCM Text_item::interpret_markup (SCM paper_smob, SCM props, SCM markup) { - if (ly_c_string_p (markup)) + if (scm_is_string (markup)) return interpret_string (paper_smob, props, SCM_EOL, markup); else if (ly_c_pair_p (markup)) { @@ -98,7 +98,7 @@ Text_item::print (SCM grob) bool Text_item::markup_p (SCM x) { - return (ly_c_string_p (x) + return (scm_is_string (x) || (ly_c_pair_p (x) && SCM_BOOL_F != scm_object_property (ly_car (x), diff --git a/lily/timing-engraver.cc b/lily/timing-engraver.cc index eebfe748af..ab5bba26c4 100644 --- a/lily/timing-engraver.cc +++ b/lily/timing-engraver.cc @@ -45,7 +45,7 @@ Timing_engraver::initialize () Moment now = now_mom (); /* Set the first bar of the score? */ - if (!ly_c_string_p (which)) + if (!scm_is_string (which)) which = (now.main_part_ || now.main_part_ == last_moment_.main_part_) ? SCM_EOL : scm_makfrom0str ("|"); @@ -63,7 +63,7 @@ Timing_engraver::start_translation_timestep () SCM which = get_property ("whichBar"); /* Set the first bar of the score? */ - if (!ly_c_string_p (which)) + if (!scm_is_string (which)) which = SCM_EOL; Moment mp = measure_position (); @@ -77,7 +77,7 @@ Timing_engraver::start_translation_timestep () ->set_property ("measure-length", mlen.smobbed_copy ()); } - if (!ly_c_string_p (which) && to_boolean (automatic_bars)) + if (!scm_is_string (which) && to_boolean (automatic_bars)) { SCM always = get_property ("barAlways"); diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index 15cc8534ec..8e2aa1b249 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -170,7 +170,7 @@ Tuplet_bracket::print (SCM smob) Output_def *pap = me->get_paper (); Stencil num; - if (ly_c_string_p (number) && number_visibility) + if (scm_is_string (number) && number_visibility) { SCM properties = Font_interface::text_font_alist_chain (me); SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number); diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 0d2d93a491..22abe4babc 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -50,7 +50,7 @@ Volta_bracket_interface::print (SCM smob) SCM glyph = endbar ? endbar->get_property ("glyph") : SCM_EOL; String str; - if (ly_c_string_p (glyph)) + if (scm_is_string (glyph)) str = ly_scm2string (glyph); else str = "|"; diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 15fe9e9c0c..f9443a2fb7 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -147,7 +147,7 @@ Volta_engraver::process_music () } if (volta_span_ && - (ly_c_string_p (start_string_) || ly_c_pair_p (start_string_))) + (scm_is_string (start_string_) || ly_c_pair_p (start_string_))) { warning (_ ("Already have a volta spanner. Stopping that one prematurely.")); @@ -162,7 +162,7 @@ Volta_engraver::process_music () } if (!volta_span_ && - (ly_c_string_p (start_string_) || ly_c_pair_p (start_string_))) + (scm_is_string (start_string_) || ly_c_pair_p (start_string_))) { started_mom_ = now_mom () ;