From afa98722d22b2cc4c98254ff05c9ee164cf98bae Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Thu, 4 Jan 2007 14:09:48 +0100 Subject: [PATCH] Update guile interface. Chagne scm_makfrom0str -> scm_from_locale_string, use ly_string2scm if possible. --- lily/all-font-metrics.cc | 2 +- lily/beam-quanting.cc | 2 +- lily/clef.cc | 2 +- lily/context-scheme.cc | 2 +- lily/context.cc | 2 +- lily/duration.cc | 2 +- lily/dynamic-engraver.cc | 2 +- lily/dynamic-performer.cc | 2 +- lily/easy-notation.cc | 2 +- lily/engraver.cc | 4 ++-- lily/font-metric-scheme.cc | 2 +- lily/font-metric.cc | 2 +- lily/function-documentation.cc | 4 ++-- lily/grob-interface.cc | 2 +- lily/grob-property.cc | 4 ++-- lily/guile-init.cc | 2 +- lily/include/lily-guile.hh | 1 + lily/include/relocate.hh | 2 +- lily/input-scheme.cc | 4 ++-- lily/lexer.ll | 16 ++++++++-------- lily/lily-guile.cc | 2 +- lily/lily-lexer.cc | 4 ++-- lily/lily-parser-scheme.cc | 4 ++-- lily/lily-parser.cc | 2 +- lily/lilypond-key.cc | 8 ++++---- lily/lookup.cc | 2 +- lily/lyric-engraver.cc | 2 +- lily/main.cc | 2 +- lily/modified-font-metric.cc | 2 +- lily/note-name-engraver.cc | 2 +- lily/open-type-font.cc | 2 +- lily/pango-font.cc | 12 ++++++------ lily/pango-select-scheme.cc | 2 +- lily/pango-select.cc | 2 +- lily/paper-column.cc | 4 ++-- lily/parser.yy | 18 +++++++++--------- lily/pfb.cc | 2 +- lily/pitch.cc | 2 +- lily/repeat-acknowledge-engraver.cc | 2 +- lily/slur-scoring.cc | 2 +- lily/source-file.cc | 4 ++-- lily/span-bar.cc | 2 +- lily/text-metrics.cc | 2 +- lily/tie-column.cc | 2 +- lily/time-signature.cc | 4 ++-- lily/translator.cc | 2 +- lily/ttf.cc | 2 +- lily/vaticana-ligature-engraver.cc | 4 ++-- lily/vertical-align-engraver.cc | 2 +- lily/volta-repeat-iterator.cc | 2 +- 50 files changed, 83 insertions(+), 82 deletions(-) diff --git a/lily/all-font-metrics.cc b/lily/all-font-metrics.cc index c5caf100ad..bc100e77bc 100644 --- a/lily/all-font-metrics.cc +++ b/lily/all-font-metrics.cc @@ -109,7 +109,7 @@ Open_type_font * All_font_metrics::find_otf (string name) { SCM sname = ly_symbol2scm (name.c_str ()); - SCM name_string = scm_makfrom0str (name.c_str ()); + SCM name_string = ly_string2scm (name); SCM val; if (!otf_dict_->try_retrieve (sname, &val)) { diff --git a/lily/beam-quanting.cc b/lily/beam-quanting.cc index fc60f8def0..0d7cca3e88 100644 --- a/lily/beam-quanting.cc +++ b/lily/beam-quanting.cc @@ -323,7 +323,7 @@ Beam::quanting (SCM smob, SCM posns) // debug quanting me->set_property ("quant-score", - scm_makfrom0str (qscores[best_idx].score_card_.c_str ())); + ly_string2scm (qscores[best_idx].score_card_)); } #endif diff --git a/lily/clef.cc b/lily/clef.cc index 36427055f5..5cd041bfae 100644 --- a/lily/clef.cc +++ b/lily/clef.cc @@ -31,7 +31,7 @@ Clef::calc_glyph_name (SCM smob) str += "_change"; } - return scm_makfrom0str (str.c_str ()); + return ly_string2scm (str); } s->suicide (); diff --git a/lily/context-scheme.cc b/lily/context-scheme.cc index 9827c8bd41..825a77112e 100644 --- a/lily/context-scheme.cc +++ b/lily/context-scheme.cc @@ -20,7 +20,7 @@ LY_DEFINE (ly_context_id, "ly:context-id", Context *tr = unsmob_context (context); SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context"); - return scm_makfrom0str (tr->id_string ().c_str ()); + return ly_string2scm (tr->id_string ()); } LY_DEFINE (ly_context_name, "ly:context-name", diff --git a/lily/context.cc b/lily/context.cc index 45a1562b1f..9d10d5378f 100644 --- a/lily/context.cc +++ b/lily/context.cc @@ -337,7 +337,7 @@ Context::create_context (Context_def *cdef, send_stream_event (this, "CreateContext", 0, ly_symbol2scm ("ops"), ops, ly_symbol2scm ("type"), cdef->get_context_name (), - ly_symbol2scm ("id"), scm_makfrom0str (id.c_str ())); + ly_symbol2scm ("id"), ly_string2scm (id)); event_source_-> remove_listener (GET_LISTENER (acknowledge_infant), ly_symbol2scm ("AnnounceNewContext")); diff --git a/lily/duration.cc b/lily/duration.cc index 413ac889ec..8020cd42d4 100644 --- a/lily/duration.cc +++ b/lily/duration.cc @@ -91,7 +91,7 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *) Duration *r = (Duration *) SCM_CELL_WORD_1 (s); scm_puts ("#to_string ().c_str ()), port); + scm_display (ly_string2scm (r->to_string ()), port); scm_puts (" >", port); return 1; diff --git a/lily/dynamic-engraver.cc b/lily/dynamic-engraver.cc index 6882939d88..0bacd813fd 100644 --- a/lily/dynamic-engraver.cc +++ b/lily/dynamic-engraver.cc @@ -261,7 +261,7 @@ Dynamic_engraver::process_music () if (scm_is_string (s) || scm_is_pair (s)) { cresc_->set_property ("edge-text", - scm_cons (s, scm_makfrom0str (""))); + scm_cons (s, scm_from_locale_string (""))); context ()->set_property ((start_type + "Text").c_str (), SCM_EOL); } diff --git a/lily/dynamic-performer.cc b/lily/dynamic-performer.cc index 0dd4556060..52939ec2e3 100644 --- a/lily/dynamic-performer.cc +++ b/lily/dynamic-performer.cc @@ -80,7 +80,7 @@ Dynamic_performer::process_music () s = get_property ("instrumentName"); if (!scm_is_string (s)) - s = scm_makfrom0str ("piano"); + s = scm_from_locale_string ("piano"); SCM eq = get_property ("instrumentEqualizer"); if (ly_is_procedure (eq)) diff --git a/lily/easy-notation.cc b/lily/easy-notation.cc index c6ecb0e20f..7931d08e48 100644 --- a/lily/easy-notation.cc +++ b/lily/easy-notation.cc @@ -47,7 +47,7 @@ Note_head::brew_ez_stencil (SCM smob) char s[2] = "a"; s[0] = (pit->get_notename () + 2) % 7 + 'a'; s[0] = toupper (s[0]); - charstr = scm_makfrom0str (s); + charstr = scm_from_locale_string (s); } SCM letter diff --git a/lily/engraver.cc b/lily/engraver.cc index c8eb805638..544309138d 100644 --- a/lily/engraver.cc +++ b/lily/engraver.cc @@ -134,8 +134,8 @@ Engraver::internal_make_grob (SCM symbol, SCM cause, char const *name, char cons #ifndef NDEBUG if (ly_is_procedure (creation_callback)) scm_apply_0 (creation_callback, - scm_list_n (grob->self_scm (), scm_makfrom0str (file), - scm_from_int (line), scm_makfrom0str (fun), SCM_UNDEFINED)); + scm_list_n (grob->self_scm (), scm_from_locale_string (file), + scm_from_int (line), scm_from_locale_string (fun), SCM_UNDEFINED)); #endif return grob; diff --git a/lily/font-metric-scheme.cc b/lily/font-metric-scheme.cc index d04d1eab8a..319ef80fe8 100644 --- a/lily/font-metric-scheme.cc +++ b/lily/font-metric-scheme.cc @@ -122,7 +122,7 @@ LY_DEFINE (ly_font_name, "ly:font-name", Font_metric *fm = unsmob_metrics (font); SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric"); - return scm_makfrom0str (fm->font_name ().c_str ()); + return ly_string2scm (fm->font_name ()); } LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0, diff --git a/lily/font-metric.cc b/lily/font-metric.cc index a57d905b27..17c7796ded 100644 --- a/lily/font-metric.cc +++ b/lily/font-metric.cc @@ -40,7 +40,7 @@ Font_metric::find_by_name (string s) const { expr = scm_list_3 (ly_symbol2scm ("named-glyph"), self_scm (), - scm_makfrom0str (s.c_str ())); + ly_string2scm (s)); b = get_indexed_char (idx); } diff --git a/lily/function-documentation.cc b/lily/function-documentation.cc index 5081d7eb58..11b655497f 100644 --- a/lily/function-documentation.cc +++ b/lily/function-documentation.cc @@ -29,8 +29,8 @@ void ly_add_function_documentation (SCM func, + "\n" + doc; scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"), - scm_makfrom0str (s.c_str ())); - SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc)); + ly_string2scm (s)); + SCM entry = scm_cons (scm_from_locale_string (varlist), scm_from_locale_string (doc)); scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry); } diff --git a/lily/grob-interface.cc b/lily/grob-interface.cc index c47937db0f..278afa84e6 100644 --- a/lily/grob-interface.cc +++ b/lily/grob-interface.cc @@ -26,7 +26,7 @@ SCM add_interface (char const *cxx_name, lispy_name += suffix; SCM s = ly_symbol2scm (lispy_name.c_str ()); - SCM d = scm_makfrom0str (descr); + SCM d = scm_from_locale_string (descr); SCM l = parse_symbol_list (vars); ly_add_interface (s, d, l); diff --git a/lily/grob-property.cc b/lily/grob-property.cc index f1242994d5..27fb897d1b 100644 --- a/lily/grob-property.cc +++ b/lily/grob-property.cc @@ -91,9 +91,9 @@ Grob::internal_set_property (SCM sym, SCM v) if (ly_is_procedure (modification_callback)) scm_apply_0 (modification_callback, scm_list_n (self_scm (), - scm_makfrom0str (file), + scm_from_locale_string (file), scm_from_int (line), - scm_makfrom0str (fun), + scm_from_locale_string (fun), sym, v, SCM_UNDEFINED)); #endif diff --git a/lily/guile-init.cc b/lily/guile-init.cc index 77fd7c59f3..e891fc7699 100644 --- a/lily/guile-init.cc +++ b/lily/guile-init.cc @@ -41,7 +41,7 @@ ly_init_ly_module (void *) progress_indication ("]\n"); } - scm_primitive_load_path (scm_makfrom0str ("lily.scm")); + scm_primitive_load_path (scm_from_locale_string ("lily.scm")); } SCM global_lily_module; diff --git a/lily/include/lily-guile.hh b/lily/include/lily-guile.hh index e94d8ef557..c0621d2639 100644 --- a/lily/include/lily-guile.hh +++ b/lily/include/lily-guile.hh @@ -43,6 +43,7 @@ extern SCM global_lily_module; string gulp_file_to_string (string fn, bool must_exist, int size); +SCM ly_string2scm (string const &s); string ly_scm2string (SCM s); string ly_symbol2string (SCM); Rational ly_scm2rational (SCM); diff --git a/lily/include/relocate.hh b/lily/include/relocate.hh index e3af270a88..df541f9d20 100644 --- a/lily/include/relocate.hh +++ b/lily/include/relocate.hh @@ -1,5 +1,5 @@ /* - relocate.hh -- declare + relocate.hh -- declare relocation functions source file of the GNU LilyPond music typesetter diff --git a/lily/input-scheme.cc b/lily/input-scheme.cc index c24d2ed1b0..97c82de82c 100644 --- a/lily/input-scheme.cc +++ b/lily/input-scheme.cc @@ -47,7 +47,7 @@ LY_DEFINE (ly_input_file_line_column, int ch = 0; int col = 0; ip->get_counts (&l, &ch, &col); - return scm_list_4 (scm_makfrom0str (ip->file_string ().c_str ()), + return scm_list_4 (ly_string2scm (ip->file_string ()), scm_from_int (l), scm_from_int (ch), scm_from_int (col)); @@ -61,7 +61,7 @@ LY_DEFINE (ly_input_both_locations, { Input *ip = unsmob_input (sip); SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location"); - return scm_list_5 (scm_makfrom0str (ip->file_string ().c_str ()), + return scm_list_5 (ly_string2scm (ip->file_string ()), scm_from_int (ip->line_number ()), scm_from_int (ip->column_number ()), scm_from_int (ip->end_line_number ()), diff --git a/lily/lexer.ll b/lily/lexer.ll index b6fb615bd2..b89ce76cca 100644 --- a/lily/lexer.ll +++ b/lily/lexer.ll @@ -236,7 +236,7 @@ BOM_UTF8 \357\273\277 progress_indication ("\n"); scm_module_define (scm_car (scopes_), ly_symbol2scm ("input-file-name"), - scm_makfrom0str (s.c_str ())); + ly_string2scm (s)); } @@ -323,7 +323,7 @@ BOM_UTF8 \357\273\277 } {RESTNAME} { char const *s = YYText (); - yylval.scm = scm_makfrom0str (s); + yylval.scm = scm_from_locale_string (s); return RESTNAME; } R { @@ -427,7 +427,7 @@ BOM_UTF8 \357\273\277 /* yylval is union. Must remember STRING before setting SCM*/ string *sp = yylval.string; - yylval.scm = scm_makfrom0str (sp->c_str ()); + yylval.scm = ly_string2scm (*sp); delete sp; return is_lyric_state () ? LYRICS_STRING : STRING; } @@ -464,7 +464,7 @@ BOM_UTF8 \357\273\277 if (c == '{' || c == '}') // brace open is for not confusing dumb tools. here_input ().warning ( _ ("Brace found at end of lyric. Did you forget a space?")); - yylval.scm = scm_makfrom0str (s.c_str ()); + yylval.scm = ly_string2scm (s); return LYRICS_STRING; @@ -557,7 +557,7 @@ BOM_UTF8 \357\273\277 if (c == '{' || c == '}') here_input ().warning ( _ ("Brace found at end of markup. Did you forget a space?")); - yylval.scm = scm_makfrom0str (s.c_str ()); + yylval.scm = ly_string2scm (s); return STRING; @@ -774,7 +774,7 @@ Lily_lexer::scan_escaped_word (string str) string msg (_f ("unknown escaped string: `\\%s'", str)); LexerError (msg.c_str ()); - yylval.scm = scm_makfrom0str (str.c_str ()); + yylval.scm = ly_string2scm (str); return STRING; } @@ -802,7 +802,7 @@ Lily_lexer::scan_bare_word (string str) } } - yylval.scm = scm_makfrom0str (str.c_str ()); + yylval.scm = ly_string2scm (str); return STRING; } @@ -937,7 +937,7 @@ SCM lookup_markup_command (string s) { SCM proc = ly_lily_module_constant ("lookup-markup-command"); - return scm_call_1 (proc, scm_makfrom0str (s.c_str ())); + return scm_call_1 (proc, ly_string2scm (s)); } /* Shut up lexer warnings. */ diff --git a/lily/lily-guile.cc b/lily/lily-guile.cc index 0aa93904c9..970a11bf62 100644 --- a/lily/lily-guile.cc +++ b/lily/lily-guile.cc @@ -130,7 +130,7 @@ ly_scm2string (SCM str) } SCM -ly_string2scm (string str) +ly_string2scm (string const &str) { return scm_from_locale_stringn (str.c_str(), str.length ()); diff --git a/lily/lily-lexer.cc b/lily/lily-lexer.cc index cd0c42eaa4..97d515aaaa 100644 --- a/lily/lily-lexer.cc +++ b/lily/lily-lexer.cc @@ -193,7 +193,7 @@ Lily_lexer::keyword_list () const SCM *tail = &l; for (vsize i = 0; i < keytable_->table_.size (); i++) { - *tail = scm_acons (scm_makfrom0str (keytable_->table_[i].name_), + *tail = scm_acons (scm_from_locale_string (keytable_->table_[i].name_), scm_from_int (keytable_->table_[i].tokcode_), SCM_EOL); @@ -233,7 +233,7 @@ Lily_lexer::start_main_input () scm_module_define (scm_car (scopes_), ly_symbol2scm ("input-file-name"), - scm_makfrom0str (main_input_name_.c_str ())); + ly_string2scm (main_input_name_)); } void diff --git a/lily/lily-parser-scheme.cc b/lily/lily-parser-scheme.cc index 44e1011751..bb08e3c01b 100644 --- a/lily/lily-parser-scheme.cc +++ b/lily/lily-parser-scheme.cc @@ -142,7 +142,7 @@ LY_DEFINE (ly_parse_file, "ly:parse-file", if (error) /* TODO: pass renamed input file too. */ scm_throw (ly_symbol2scm ("ly-file-failed"), - scm_list_1 (scm_makfrom0str (file_name.c_str ()))); + scm_list_1 (ly_string2scm (file_name))); return SCM_UNSPECIFIED; } @@ -251,7 +251,7 @@ LY_DEFINE (ly_parser_output_name, "ly:parser-output-name", Lily_parser *p = unsmob_lily_parser (parser); SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser"); - return scm_makfrom0str (p->output_basename_.c_str ()); + return ly_string2scm (p->output_basename_); } LY_DEFINE (ly_parser_error, "ly:parser-error", diff --git a/lily/lily-parser.cc b/lily/lily-parser.cc index 15cb06c4d7..cfa8d3f940 100644 --- a/lily/lily-parser.cc +++ b/lily/lily-parser.cc @@ -105,7 +105,7 @@ Lily_parser::parse_file (string init, string name, string out_name) File_name f (name); string s = global_path.find (f.base_ + ".twy"); s = gulp_file_to_string (s, false, -1); - scm_eval_string (scm_makfrom0str (s.c_str ())); + scm_eval_string (ly_string2scm (s)); /* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to OUT_FILE (unless IN_FILE redefines output file name). */ diff --git a/lily/lilypond-key.cc b/lily/lilypond-key.cc index 99b190bcc4..b75d872699 100644 --- a/lily/lilypond-key.cc +++ b/lily/lilypond-key.cc @@ -63,7 +63,7 @@ Lilypond_grob_key::as_scheme () const { return scm_list_4 (context_ ? context_->self_scm () : SCM_BOOL_F, creation_moment_.smobbed_copy (), - scm_makfrom0str (grob_name_.c_str ()), + ly_string2scm (grob_name_), scm_from_int (disambiguation_count_)); } @@ -146,8 +146,8 @@ Lilypond_context_key::as_scheme () const { return scm_list_5 (parent_context_ ? parent_context_->self_scm () : SCM_BOOL_F, start_moment_.smobbed_copy (), - scm_makfrom0str (context_name_.c_str ()), - scm_makfrom0str (id_.c_str ()), + ly_string2scm (context_name_), + ly_string2scm (id_), scm_from_int (disambiguation_count_)); } @@ -213,7 +213,7 @@ SCM Lilypond_general_key::as_scheme () const { return scm_list_3 (parent_ ? parent_->self_scm () : SCM_BOOL_F, - scm_makfrom0str (name_.c_str ()), + ly_string2scm (name_), scm_from_int (disambiguation_count_)); } diff --git a/lily/lookup.cc b/lily/lookup.cc index d8c20c044f..8a81937352 100644 --- a/lily/lookup.cc +++ b/lily/lookup.cc @@ -147,7 +147,7 @@ Lookup::horizontal_line (Interval w, Real th) Stencil Lookup::blank (Box b) { - return Stencil (b, scm_makfrom0str ("")); + return Stencil (b, scm_from_locale_string ("")); } Stencil diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 06ffce0d50..3005760765 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -59,7 +59,7 @@ Lyric_engraver::process_music () { SCM text = event_->get_property ("text"); - if (ly_is_equal (text, scm_makfrom0str (" "))) + if (ly_is_equal (text, scm_from_locale_string (" "))) { if (last_text_) last_text_->set_property ("self-alignment-X", scm_from_int (LEFT)); diff --git a/lily/main.cc b/lily/main.cc index b9e1ce28ea..7b2dfd29bb 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -424,7 +424,7 @@ main_with_guile (void *, int, char **) SCM *tail = &files; while (char const *arg = option_parser->get_next_arg ()) { - *tail = scm_cons (scm_makfrom0str (arg), SCM_EOL); + *tail = scm_cons (scm_from_locale_string (arg), SCM_EOL); tail = SCM_CDRLOC (*tail); } diff --git a/lily/modified-font-metric.cc b/lily/modified-font-metric.cc index e0fb13044d..91e9698032 100644 --- a/lily/modified-font-metric.cc +++ b/lily/modified-font-metric.cc @@ -178,7 +178,7 @@ Modified_font_metric::text_stencil (string text) const Box Modified_font_metric::text_dimension (string text) const { - SCM stext = scm_makfrom0str (text.c_str ()); + SCM stext = ly_string2scm (text); Box b; if (output_backend_global == "tex") diff --git a/lily/note-name-engraver.cc b/lily/note-name-engraver.cc index f3c081f039..dfff746e27 100644 --- a/lily/note-name-engraver.cc +++ b/lily/note-name-engraver.cc @@ -50,7 +50,7 @@ Note_name_engraver::process_music () if (s.length ()) { Item *t = make_item ("NoteName", events_[0]->self_scm ()); - t->set_property ("text", scm_makfrom0str (s.c_str ())); + t->set_property ("text", ly_string2scm (s)); texts_.push_back (t); } } diff --git a/lily/open-type-font.cc b/lily/open-type-font.cc index 2f2e5fdaad..7e025bc5b2 100644 --- a/lily/open-type-font.cc +++ b/lily/open-type-font.cc @@ -296,7 +296,7 @@ Open_type_font::glyph_list () const if (code) warning (_f ("FT_Get_Glyph_Name() returned error: %u", unsigned (code))); - *tail = scm_cons (scm_makfrom0str (name), SCM_EOL); + *tail = scm_cons (scm_from_locale_string (name), SCM_EOL); tail = SCM_CDRLOC (*tail); } diff --git a/lily/pango-font.cc b/lily/pango-font.cc index 3d58e0dd0e..77d279ab90 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -69,8 +69,8 @@ void Pango_font::register_font_file (string filename, string ps_name) { scm_hash_set_x (physical_font_tab_, - scm_makfrom0str (ps_name.c_str ()), - scm_makfrom0str (filename.c_str ())); + ly_string2scm (ps_name), + ly_string2scm (filename)); } void @@ -204,7 +204,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str, char_id = scm_from_uint32 (pg); } else - char_id = scm_makfrom0str (glyph_name); + char_id = scm_from_locale_string (glyph_name); *tail = scm_cons (scm_list_4 (scm_from_double (ggeo.width * scale_), scm_from_double (ggeo.x_offset * scale_), @@ -261,7 +261,7 @@ Pango_font::pango_item_string_stencil (PangoItem const *item, string str, pango_fc_font_unlock_face (fcfont); SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"), - scm_makfrom0str (ps_name.c_str ()), + ly_string2scm (ps_name), scm_from_double (size), scm_from_bool (cid_keyed), ly_quote_scm (glyph_exprs)); @@ -355,8 +355,8 @@ Pango_font::text_stencil (string str, bool tight) const */ SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"), - scm_makfrom0str (description_string ().c_str ()), - scm_makfrom0str (str.c_str ())); + ly_string2scm (description_string ()), + ly_string2scm (str)); Box b (Interval (0, 0), Interval (0, 0)); b.unite (dest.extent_box ()); diff --git a/lily/pango-select-scheme.cc b/lily/pango-select-scheme.cc index 89330c842a..7a48daf535 100644 --- a/lily/pango-select-scheme.cc +++ b/lily/pango-select-scheme.cc @@ -19,7 +19,7 @@ LY_DEFINE (ly_make_pango_description_string, "ly:make-pango-description-string", PangoFontDescription *pfd = properties_to_pango_description (chain, scm_to_double (size)); char *str = pango_font_description_to_string (pfd); - SCM scm_str = scm_makfrom0str (str); + SCM scm_str = scm_from_locale_string (str); g_free (str); pango_font_description_free (pfd); return scm_str; diff --git a/lily/pango-select.cc b/lily/pango-select.cc index bd684b92f8..5d032f252b 100644 --- a/lily/pango-select.cc +++ b/lily/pango-select.cc @@ -56,7 +56,7 @@ select_pango_font (Output_def *layout, SCM chain) * layout->get_dimension (ly_symbol2scm ("text-font-size"))); char *str = pango_font_description_to_string (pfd); - SCM scm_str = scm_makfrom0str (str); + SCM scm_str = scm_from_locale_string (str); g_free (str); return find_pango_font (layout, scm_str, 1.0); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index 2636b20fe4..ac653f0b6c 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -152,10 +152,10 @@ Paper_column::print (SCM p) SCM scm_mol = Text_interface::interpret_markup (me->layout ()->self_scm (), properties, - scm_makfrom0str (r.c_str ())); + ly_string2scm (r)); SCM when_mol = Text_interface::interpret_markup (me->layout ()->self_scm (), properties, - scm_makfrom0str (when.c_str ())); + ly_string2scm (when)); Stencil t = *unsmob_stencil (scm_mol); t.add_at_edge (Y_AXIS, DOWN, *unsmob_stencil (when_mol), 0.1, 0.1); t.align_to (X_AXIS, CENTER); diff --git a/lily/parser.yy b/lily/parser.yy index 7ea90f93da..977f1a697f 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1701,25 +1701,25 @@ gen_text_def: script_abbreviation: '^' { - $$ = scm_makfrom0str ("Hat"); + $$ = scm_from_locale_string ("Hat"); } | '+' { - $$ = scm_makfrom0str ("Plus"); + $$ = scm_from_locale_string ("Plus"); } | '-' { - $$ = scm_makfrom0str ("Dash"); + $$ = scm_from_locale_string ("Dash"); } | '|' { - $$ = scm_makfrom0str ("Bar"); + $$ = scm_from_locale_string ("Bar"); } | ANGLE_CLOSE { - $$ = scm_makfrom0str ("Larger"); + $$ = scm_from_locale_string ("Larger"); } | '.' { - $$ = scm_makfrom0str ("Dot"); + $$ = scm_from_locale_string ("Dot"); } | '_' { - $$ = scm_makfrom0str ("Underscore"); + $$ = scm_from_locale_string ("Underscore"); } ; @@ -2384,7 +2384,7 @@ Lily_lexer::try_special_identifiers (SCM *destination, SCM sid) SCM get_next_unique_context_id () { - return scm_makfrom0str ("$uniqueContextId"); + return scm_from_locale_string ("$uniqueContextId"); } @@ -2394,7 +2394,7 @@ get_next_unique_lyrics_context_id () static int new_context_count; char s[128]; snprintf (s, sizeof (s)-1, "uniqueContext%d", new_context_count++); - return scm_makfrom0str (s); + return scm_from_locale_string (s); } diff --git a/lily/pfb.cc b/lily/pfb.cc index a96aac7761..11ee5d90c5 100644 --- a/lily/pfb.cc +++ b/lily/pfb.cc @@ -85,7 +85,7 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa", vector pfb_string = gulp_file (file_name, 0); char *pfa = pfb2pfa ((Byte *) &pfb_string[0], pfb_string.size ()); - SCM pfa_scm = scm_makfrom0str (pfa); + SCM pfa_scm = scm_from_locale_string (pfa); free (pfa); if (be_verbose_global) diff --git a/lily/pitch.cc b/lily/pitch.cc index da3a8a01dd..c0a24f47b2 100644 --- a/lily/pitch.cc +++ b/lily/pitch.cc @@ -245,7 +245,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *) { Pitch *r = (Pitch *) SCM_CELL_WORD_1 (s); scm_puts ("#to_string ().c_str ()), port); + scm_display (ly_string2scm (r->to_string ()), port); scm_puts (" >", port); return 1; } diff --git a/lily/repeat-acknowledge-engraver.cc b/lily/repeat-acknowledge-engraver.cc index 56301cd2a3..0f94383838 100644 --- a/lily/repeat-acknowledge-engraver.cc +++ b/lily/repeat-acknowledge-engraver.cc @@ -102,7 +102,7 @@ Repeat_acknowledge_engraver::process_music () if (!scm_is_string (wb) || ly_is_equal (db, wb)) { if (s != "" || (volta_found && !scm_is_string (wb))) - context ()->set_property ("whichBar", scm_makfrom0str (s.c_str ())); + context ()->set_property ("whichBar", ly_string2scm (s)); } } diff --git a/lily/slur-scoring.cc b/lily/slur-scoring.cc index bccee086c5..ef252da5dd 100644 --- a/lily/slur-scoring.cc +++ b/lily/slur-scoring.cc @@ -362,7 +362,7 @@ Slur_score_state::get_best_curve () } slur_->set_property ("quant-score", - scm_makfrom0str (total.c_str ())); + ly_string2scm (total)); } #endif diff --git a/lily/source-file.cc b/lily/source-file.cc index 4415e8dad7..e6aae1ceae 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -138,9 +138,9 @@ Source_file::Source_file (string filename_string) void Source_file::init_port () { - SCM str = scm_makfrom0str (c_str ()); + SCM str = scm_from_locale_string (c_str ()); str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__); - scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ())); + scm_set_port_filename_x (str_port_, ly_string2scm (name_)); } diff --git a/lily/span-bar.cc b/lily/span-bar.cc index 4566d73f77..bd10b1c671 100644 --- a/lily/span-bar.cc +++ b/lily/span-bar.cc @@ -185,7 +185,7 @@ Span_bar::calc_glyph_name (SCM smob) else if (type == ":|:") type = ".|."; - return scm_makfrom0str (type.c_str ()); + return ly_string2scm (type); } Interval diff --git a/lily/text-metrics.cc b/lily/text-metrics.cc index 164d0062ff..fcab0495f8 100644 --- a/lily/text-metrics.cc +++ b/lily/text-metrics.cc @@ -31,7 +31,7 @@ lookup_tex_text_dimension (Font_metric *font, SCM text) if (text_dimension_hash_tab) { scm_hash_ref (text_dimension_hash_tab, - scm_makfrom0str (key_str.c_str ()), + ly_string2scm (key_str), SCM_BOOL_F); } if (scm_is_pair (val)) diff --git a/lily/tie-column.cc b/lily/tie-column.cc index dd54530e81..39c51fefc3 100644 --- a/lily/tie-column.cc +++ b/lily/tie-column.cc @@ -120,7 +120,7 @@ Tie_column::calc_positioning_done (SCM smob) card += to_string ("TOTAL=%.2f", base.score ()); ties[i]->set_property ("quant-score", - scm_makfrom0str (card.c_str ())); + ly_string2scm (card)); } #endif diff --git a/lily/time-signature.cc b/lily/time-signature.cc index ced6468e8d..fa1bfadbd6 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -94,9 +94,9 @@ Time_signature::numbered_time_signature (Grob *me, int num, int den) chain); SCM sn = Text_interface::interpret_markup (me->layout ()->self_scm (), chain, - scm_makfrom0str (to_string (num).c_str ())); + ly_string2scm (to_string (num))); SCM sd = Text_interface::interpret_markup (me->layout ()->self_scm (), chain, - scm_makfrom0str (to_string (den).c_str ())); + ly_string2scm (to_string (den))); Stencil n = *unsmob_stencil (sn); Stencil d = *unsmob_stencil (sd); diff --git a/lily/translator.cc b/lily/translator.cc index b7a46d29b6..8820879e01 100644 --- a/lily/translator.cc +++ b/lily/translator.cc @@ -199,7 +199,7 @@ Translator::static_translator_description (const char *grobs, parse_symbol_list (grobs), static_properties); static_properties = scm_acons (ly_symbol2scm ("description"), - scm_makfrom0str (desc), static_properties); + scm_from_locale_string (desc), static_properties); SCM list = SCM_EOL; for (; listener_list; listener_list = listener_list->next_) diff --git a/lily/ttf.cc b/lily/ttf.cc index 2e5eb8865d..1cb6fdc83c 100644 --- a/lily/ttf.cc +++ b/lily/ttf.cc @@ -231,7 +231,7 @@ LY_DEFINE (ly_ttf_ps_name, "ly:ttf-ps-name", FT_Face face = open_ft_face (file_name); char const *ps_name_str0 = FT_Get_Postscript_Name (face); - SCM ps_name = scm_makfrom0str (ps_name_str0 ? ps_name_str0 : ""); + SCM ps_name = scm_from_locale_string (ps_name_str0 ? ps_name_str0 : ""); FT_Done_Face (face); diff --git a/lily/vaticana-ligature-engraver.cc b/lily/vaticana-ligature-engraver.cc index 608cb16c66..6cd3c0bdac 100644 --- a/lily/vaticana-ligature-engraver.cc +++ b/lily/vaticana-ligature-engraver.cc @@ -681,7 +681,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, if (prev_primitive) prev_primitive->set_property ("glyph-name", - scm_makfrom0str (prev_glyph_name.c_str ())); + ly_string2scm (prev_glyph_name)); /* * In the backend, flexa shapes and joins need to know about line @@ -699,7 +699,7 @@ Vaticana_ligature_engraver::transform_heads (Spanner *ligature, } prev_primitive->set_property ("glyph-name", - scm_makfrom0str (prev_glyph_name.c_str ())); + ly_string2scm (prev_glyph_name)); align_heads (primitives, flexa_width, thickness); diff --git a/lily/vertical-align-engraver.cc b/lily/vertical-align-engraver.cc index 830aa78fd7..e1685077c1 100644 --- a/lily/vertical-align-engraver.cc +++ b/lily/vertical-align-engraver.cc @@ -102,7 +102,7 @@ Vertical_align_engraver::acknowledge_axis_group (Grob_info i) { string id = i.context ()->id_string (); - scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.c_str ()), + scm_hash_set_x (id_to_group_hashtab_, ly_string2scm (id), i.grob ()->self_scm ()); SCM before_id = i.context ()->get_property ("alignAboveContext"); diff --git a/lily/volta-repeat-iterator.cc b/lily/volta-repeat-iterator.cc index 1828dfdbca..7e803b81c8 100644 --- a/lily/volta-repeat-iterator.cc +++ b/lily/volta-repeat-iterator.cc @@ -98,7 +98,7 @@ Volta_repeat_iterator::next_element (bool side_effect) if (done_count_ <= alt_count_) add_repeat_command (scm_list_n (ly_symbol2scm ("volta"), - scm_makfrom0str (repstr.c_str ()), SCM_UNDEFINED)); + ly_string2scm (repstr), SCM_UNDEFINED)); } else add_repeat_command (ly_symbol2scm ("end-repeat")); -- 2.39.2