]> git.donarmstrong.com Git - lilypond.git/commitdiff
Update guile interface.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Jan 2007 13:09:48 +0000 (14:09 +0100)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 4 Jan 2007 13:09:48 +0000 (14:09 +0100)
Chagne scm_makfrom0str -> scm_from_locale_string, use ly_string2scm if
possible.

50 files changed:
lily/all-font-metrics.cc
lily/beam-quanting.cc
lily/clef.cc
lily/context-scheme.cc
lily/context.cc
lily/duration.cc
lily/dynamic-engraver.cc
lily/dynamic-performer.cc
lily/easy-notation.cc
lily/engraver.cc
lily/font-metric-scheme.cc
lily/font-metric.cc
lily/function-documentation.cc
lily/grob-interface.cc
lily/grob-property.cc
lily/guile-init.cc
lily/include/lily-guile.hh
lily/include/relocate.hh
lily/input-scheme.cc
lily/lexer.ll
lily/lily-guile.cc
lily/lily-lexer.cc
lily/lily-parser-scheme.cc
lily/lily-parser.cc
lily/lilypond-key.cc
lily/lookup.cc
lily/lyric-engraver.cc
lily/main.cc
lily/modified-font-metric.cc
lily/note-name-engraver.cc
lily/open-type-font.cc
lily/pango-font.cc
lily/pango-select-scheme.cc
lily/pango-select.cc
lily/paper-column.cc
lily/parser.yy
lily/pfb.cc
lily/pitch.cc
lily/repeat-acknowledge-engraver.cc
lily/slur-scoring.cc
lily/source-file.cc
lily/span-bar.cc
lily/text-metrics.cc
lily/tie-column.cc
lily/time-signature.cc
lily/translator.cc
lily/ttf.cc
lily/vaticana-ligature-engraver.cc
lily/vertical-align-engraver.cc
lily/volta-repeat-iterator.cc

index c5caf100adf7c7dc09b832d52d7019b596517dc9..bc100e77bc39b7e967e1c3f880e8c0058a06ee53 100644 (file)
@@ -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))
     {
index fc60f8def08ed25b1529ebcd8ff5bca05fca0167..0d7cca3e88950a50638add5fadbd6be80f768476 100644 (file)
@@ -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
 
index 36427055f525f4522af68132732fba502de4edc5..5cd041bfaeab5cefa92a5b2a742b2f9e4f0713eb 100644 (file)
@@ -31,7 +31,7 @@ Clef::calc_glyph_name (SCM smob)
          str += "_change";
        }
 
-      return scm_makfrom0str (str.c_str ());
+      return ly_string2scm (str);
     }
 
   s->suicide ();
index 9827c8bd417161bb65539c9ec46b249a35598e5b..825a77112eaab40c6945894b48fa9a803145db8e 100644 (file)
@@ -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",
index 45a1562b1f98a6d255c7da7d2af73f065744d66b..9d10d5378fd2c875c6dc24387ad238d7edc3d185 100644 (file)
@@ -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"));
index 413ac889ec497e7447b5e443c8e783b3704513dd..8020cd42d4a161e33de1bd597e9ff06ee50d4de2 100644 (file)
@@ -91,7 +91,7 @@ Duration::print_smob (SCM s, SCM port, scm_print_state *)
   Duration *r = (Duration *) SCM_CELL_WORD_1 (s);
 
   scm_puts ("#<Duration ", port);
-  scm_display (scm_makfrom0str (r->to_string ().c_str ()), port);
+  scm_display (ly_string2scm (r->to_string ()), port);
   scm_puts (" >", port);
 
   return 1;
index 6882939d883904a7744d81809df69adfef1c9b1a..0bacd813fd932ce21762c86bbc6dc1cfb5604afd 100644 (file)
@@ -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);
                }
index 0dd455606095a99c8326f447d3b30b245ede81ab..52939ec2e3c3f288273a1b19f622ab68f1b92025 100644 (file)
@@ -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))
index c6ecb0e20f4539a48301f0e959ac96f2240374c4..7931d08e482fb2e9647b53cebbc3a6bed6c63153 100644 (file)
@@ -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
index c8eb805638d4619ba378968f103c815842f162b4..544309138dee5fae3dd88b76202ccfc89e6bb133 100644 (file)
@@ -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;
index d04d1eab8ad8c7213a1cdb3468b2f5310a357bda..319ef80fe8c56f1d194adfc825a41455cb6675c5 100644 (file)
@@ -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,
index a57d905b27973ac06f6f2b026ae1414006e05c38..17c7796ded08812545092920265059ac6705603a 100644 (file)
@@ -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);
     }
 
index 5081d7eb58592dc082eabe6af715e3d000225dbc..11b655497f976792dd3611549dc39badd15ba945 100644 (file)
@@ -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);
 }
 
index c47937db0f2737ef292f8a5ffba97583a4b5c73e..278afa84e62eee172ae6763d681abb8eac8b3da2 100644 (file)
@@ -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);
index f1242994d53fb696133cbedfc6e6b2bc1b9336ce..27fb897d1b617f8e21f5c0767f3f9d2cf4dd00f5 100644 (file)
@@ -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
 
index 77fd7c59f30630ddf4eccc8dc22f9ae0769c399e..e891fc76997332f14b503ca0cc64643e17b0bd08 100644 (file)
@@ -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;
index e94d8ef557aac4c4d0aaddd99abfddbc3689486e..c0621d26398cba2e74c804840bd88b9da680fdd0 100644 (file)
@@ -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);
index e3af270a88e2c6d1bc9ab955abfa6c9bfc2cbb7f..df541f9d2037e01f68df4ff9496caa2da3c55e86 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  relocate.hh -- declare
+  relocate.hh -- declare relocation functions
 
   source file of the GNU LilyPond music typesetter
 
index c24d2ed1b0d3e0cddfe8786daa81b6a0bb63c56f..97c82de82c9aa5b8510e1d79bd6f18a743ac56f7 100644 (file)
@@ -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 ()),
index b6fb615bd262647803392df890f6b284a04728d5..b89ce76cca117f1e8b92121c2e023a1187c62937 100644 (file)
@@ -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
 }
 <chords,notes,figures>{RESTNAME}       {
        char const *s = YYText ();
-       yylval.scm = scm_makfrom0str (s);
+       yylval.scm = scm_from_locale_string (s);
        return RESTNAME;
 }
 <chords,notes,figures>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.  */
index 0aa93904c98a34e0645b1615949c5266a1372420..970a11bf62cfec32fbe1879b88b6d52ff5fac4e8 100644 (file)
@@ -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 ());
index cd0c42eaa4eedf910386703de34a975ffaf43909..97d515aaaa278237c88de3722973588b21bf1984 100644 (file)
@@ -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
index 44e101175133c5a603513a7c8531d0293decbf3a..bb08e3c01b4ef5849d866121f292bcc89739e0b2 100644 (file)
@@ -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",
index 15cb06c4d7319af1b0915e501c467dd4c8f34268..cfa8d3f9400d51466db40aa57e005c5d2d5cb03c 100644 (file)
@@ -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).  */
index 99b190bcc4801346fe4624f6288b49eb57e3a7fd..b75d872699c7d456ef0744e19517ab4b8c9bdaaa 100644 (file)
@@ -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_));
 }
 
index d8c20c044fcd871b36f831b83adf022ed28c0c54..8a81937352cf543edcca502706b422341a43ae8e 100644 (file)
@@ -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
index 06ffce0d50ad4cc354015a88e4e623beb2d1da53..3005760765b00c0cb5f4febb34fe1d1ba679df86 100644 (file)
@@ -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));
index b9e1ce28ea591c42843a9a99beba7b06b7d5d81f..7b2dfd29bb531bbe6860eddbb22299f498275bae 100644 (file)
@@ -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);
     }
   
index e0fb13044d14d239858aa83ccd0fb0e4aa9dae84..91e9698032ef28611004030946bcff12c5576ab9 100644 (file)
@@ -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")
index f3c081f0395a5af2f0c5a95bc2f0af302d539c32..dfff746e2705810e2b44bcfa4efda66257b4b590 100644 (file)
@@ -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);
     }
 }
index 2f2e5fdaad3d50b7eb2cc755ef0083243487d596..7e025bc5b2a0b0a323b4659c2e90726c6c57be6d 100644 (file)
@@ -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);
     }
   
index 3d58e0dd0ed69cbbd4a701b425d6c94e3d27549e..77d279ab906bb6c34c56004014d25899cc0a6f6a 100644 (file)
@@ -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 ());
index 89330c842ab88a263c49669f2878f8c550ddb93f..7a48daf53584c0e7be0b18582398d3c8a9a6946e 100644 (file)
@@ -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;
index bd684b92f857344bb7f91ff02d41b3940da660a8..5d032f252bcaecbd5ea890d5485e470968e45855 100644 (file)
@@ -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);
index 2636b20fe4bccee354e4b9b915f060f8e6f082af..ac653f0b6cba1bf2685ae01d7c34f5c1246f4eee 100644 (file)
@@ -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);
index 7ea90f93da1d03fcf3fca901dcec1a6f0615537c..977f1a697f73b8ca50a8678afca5a58781bfc5b3 100644 (file)
@@ -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);
 }
 
 
index a96aac7761deb7518e5c69e6c6132463b5ee5a16..11ee5d90c545c1159789f6b3ab81475586ab8be1 100644 (file)
@@ -85,7 +85,7 @@ LY_DEFINE (ly_pfb_to_pfa, "ly:pfb->pfa",
   vector<char> 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)
index da3a8a01dd6f4c2f12100799137da6a19cd7f3a3..c0a24f47b2b3a0fb79b067c0deb84c7cddf2d152 100644 (file)
@@ -245,7 +245,7 @@ Pitch::print_smob (SCM s, SCM port, scm_print_state *)
 {
   Pitch *r = (Pitch *) SCM_CELL_WORD_1 (s);
   scm_puts ("#<Pitch ", port);
-  scm_display (scm_makfrom0str (r->to_string ().c_str ()), port);
+  scm_display (ly_string2scm (r->to_string ()), port);
   scm_puts (" >", port);
   return 1;
 }
index 56301cd2a33b9c9a5b51fb32f67e0bb95fde4be9..0f9438383824778f12690aa3cfe9e60b666e8f1a 100644 (file)
@@ -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));
     }
 }
 
index bccee086c57491ec90024ff865f21d1fa9c2d29c..ef252da5ddac8191893816d0f45fefe6e8252166 100644 (file)
@@ -362,7 +362,7 @@ Slur_score_state::get_best_curve ()
        }
   
       slur_->set_property ("quant-score",
-                          scm_makfrom0str (total.c_str ()));
+                          ly_string2scm (total));
     }
 #endif
 
index 4415e8dad70978c15fef06b31c2f6cd6791f7a2b..e6aae1ceaebd05be3c197777c1032babc52c1450 100644 (file)
@@ -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_));
 }
 
 
index 4566d73f77080e486530436499324cc48f67b630..bd10b1c671223435cf97786178e7dfe74d4b68cb 100644 (file)
@@ -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
index 164d0062ffdf5452a97560207321591c2fe1347a..fcab0495f858d693f9efe9c548f036cdc0fabd99 100644 (file)
@@ -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))
index dd54530e812edd8e5afcc581573ea0f8a393d0be..39c51fefc36ae0731c7d91a830bead7bf97a1258 100644 (file)
@@ -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
       
index ced6468e8dbba8dcc2d0c042cedc4c924b1ff264..fa1bfadbd6954467bd9ba36122413e0aaed57eb7 100644 (file)
@@ -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);
index b7a46d29b65b20c67aa724b351012b0c18817da3..8820879e019cc168c438790003873660ac89b8a0 100644 (file)
@@ -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_)
index 2e5eb8865d14a6223f787afda487d1745d49eab3..1cb6fdc83cb71f52a9310b08730a9b919ba77f41 100644 (file)
@@ -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);
   
index 608cb16c66c87b23c5ed7411d29b4f565d4322d2..6cd3c0bdac6de7f13a4003c04e6f12c291160224 100644 (file)
@@ -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);
 
index 830aa78fd7283ac2ea37f460fee266f110647769..e1685077c197642a73deedf00a833af3edc7175c 100644 (file)
@@ -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");
index 1828dfdbca9b49d062752118c554abfc9cd7737d..7e803b81c8c038a721dc7e9e650483a1aaf74602 100644 (file)
@@ -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"));