substitute appropriate functions.
* flower/include/string.hh (class String): remove to_str0 and
is_empty(). S&R everywhere.
+2006-01-24 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * buildscripts/analyse-cxx-log.py: new file. Read compile log to
+ substitute appropriate functions.
+
+ * flower/include/string.hh (class String): remove to_str0 and
+ is_empty(). S&R everywhere.
+
2006-01-23 Graham Percival <gpermus@gmail.com>
* Documentation/user/basic-notation.itely: add hairpin
2006-01-22 Nicolas Sceaux <nicolas.sceaux@free.fr>
- * ly/music-functions-init.ly (parallelMusic): new music function for parallel
- music entry.
+ * ly/music-functions-init.ly (parallelMusic): new music function
+ for parallel music entry.
- * scm/define-music-properties.scm (all-music-properties): new 'void music property
+ * scm/define-music-properties.scm (all-music-properties): new
+ 'void music property
* scm/music-functions.scm (ly:music-message): make public, to be
used in music function definitions
--- /dev/null
+#!/usr/bin/python
+import sys
+import os
+import re
+import string
+
+if len (sys.argv) < 5:
+ print 'args: LOGFILE CLASS FUNC NEW_FUNC'
+
+func = sys.argv[3]
+new_func = sys.argv[4]
+klazz = sys.argv[2]
+log_ls = open (sys.argv[1]).readlines ()
+regex = re.compile ("([^:]+):([0-9]+): error: .class ([_a-zA-Z]+). has no member named .%s." % func)
+
+files = {}
+
+for l in log_ls:
+ m = regex.search (l)
+ if not m:
+ continue
+ print l
+
+ file = m.group (1)
+ line_no = string.atoi (m.group (2))
+ klass = m.group (3)
+
+ if klass <> klazz:
+ continue
+
+ if not files.has_key (file):
+ files[file] = open (file).read ().split ('\n')
+
+ line_no -= 1
+ files[file][line_no] = re.sub (func, new_func, files[file][line_no])
+
+
+for (f,ls) in files.items():
+ print 'writing ', f
+ os.rename (f, f + '~')
+ open (f, 'w').write ('\n'.join (ls))
+
class File_storage
{
public:
- virtual char const *to_str0 () const = 0;
+ virtual char const *c_str () const = 0;
virtual int length () const = 0;
virtual ~File_storage (){}
};
void operator += (char const *str0);
- char const *to_str0 () const;
+ char const *c_str () const;
char *get_str0 ();
INLINE
char const *
-String_data::to_str0 () const
+String_data::c_str () const
{
return (char const *)data_byte_;
}
String_handle (String_handle const &src);
Byte const *to_bytes () const;
- char const *to_str0 () const;
+ char const *c_str () const;
Byte *get_bytes ();
char *get_str0 ();
bool is_binary_bo () const;
}
INLINE char const *
-String_handle::to_str0 () const
+String_handle::c_str () const
{
return (char const *)data->to_bytes ();
}
Byte *get_copy_byte () const;
char *get_copy_str0 () const;
- char const *to_str0 () const;
Byte const *to_bytes () const;
char *get_str0 ();
Byte *get_bytes ();
/// concatenate s
void operator += (char const *s) { strh_ += s; }
void operator += (String s);
-
- bool is_empty () const;
-
+
void append (String);
void prepend (String);
/// signed comparison, analogous to memcmp;
static int compare (String const &s1, const String &s2);
- /// index of rightmost c
- int index_last (char c) const;
-
/// index of rightmost element of string (???)
int index_last (char const *string) const;
+ int index_last (char c) const;
+
int index (char c) const;
/// index of leftmost occurance of STRING
INLINE
char const *
-String::to_str0 () const
+String::c_str () const
{
- return strh_.to_str0 ();
+ return strh_.c_str ();
}
// because char const* also has an operator ==, this is for safety:
return 0;
long l = 0;
- int conv = sscanf (dec_string.to_str0 (), "%ld", &l);
+ int conv = sscanf (dec_string.c_str (), "%ld", &l);
assert (conv);
return (int)l;
if (!dec_string.length ())
return 0;
double d = 0;
- int conv = sscanf (dec_string.to_str0 (), "%lf", &d);
+ int conv = sscanf (dec_string.c_str (), "%lf", &d);
assert (conv);
return d;
}
String_convert::precision_string (double x, int n)
{
String format = "%." + to_string (max (0, n - 1)) + "e";
- String str = double_string (abs (x), format.to_str0 ());
+ String str = double_string (abs (x), format.c_str ());
int exp = str.right_string (3).to_int ();
str = str.left_string (str.length () - 4);
*this = String_convert::char_string (c, n);
}
-char const *
-String::c_str () const
-{
- return to_str0 ();
-}
bool
String::empty () const
{
- return is_empty ();
+ return !length ();
}
int
return strh_.get_str0 ();
}
+#ifndef DISALLOW_OLD_STRING
bool
String::is_empty () const
{
return !length ();
}
+#endif
+
+
/**
Do a signed comparison, analogous to memcmp;
*/
if (!length ())
return -1;
- char const *me = strh_.to_str0 ();
+ char const *me = strh_.c_str ();
char const *p = (char const *)memrchr ((Byte *)me, length (), c);
if (p)
return p - me;
int
String::index (char c) const
{
- char const *me = strh_.to_str0 ();
+ char const *me = strh_.c_str ();
char const *p = (char const *) memchr (me, c, length ());
if (p)
return p - me;
int
String::index (String searchfor) const
{
- char const *me = strh_.to_str0 ();
+ char const *me = strh_.c_str ();
char const *p
= (char const *) memmem (me, length (),
- searchfor.to_str0 (), searchfor.length ());
+ searchfor.c_str (), searchfor.length ());
if (p)
return p - me;
if (!n)
return -1;
- void const *me = (void const *) strh_.to_str0 ();
+ void const *me = (void const *) strh_.c_str ();
for (int i = 0; i < set.length (); i++)
{
char *found = (char *) memchr (me, set[i], n);
String::print_on (ostream &os) const
{
if (!strh_.is_binary_bo ())
- os << to_str0 ();
+ os << c_str ();
else
for (int i = 0; i < length (); i++)
os << (Byte) (*this)[ i ];
if (s == "\n")
return;
- fputs (s.to_str0 (), stderr);
+ fputs (s.c_str (), stderr);
fflush (stderr);
if (s.length ())
progress_newline = s[s.length () - 1] == '\n';
void
warning (String s)
{
- message (_f ("warning: %s", s.to_str0 ()) + "\n");
+ message (_f ("warning: %s", s.c_str ()) + "\n");
}
void
non_fatal_error (String s)
{
- message (_f ("error: %s", s.to_str0 ()) + "\n");
+ message (_f ("error: %s", s.c_str ()) + "\n");
}
/* Display an error message. Always starts on a new line. */
*different = false;
if (scm_is_pair (accidentals) && !scm_is_symbol (scm_car (accidentals)))
warning (_f ("accidental typesetting list must begin with context-name: %s",
- ly_scm2string (scm_car (accidentals)).to_str0 ()));
+ ly_scm2string (scm_car (accidentals)).c_str ()));
for (; scm_is_pair (accidentals) && origin;
accidentals = scm_cdr (accidentals))
}
else
warning (_f ("ignoring unknown accidental: %s",
- ly_symbol2string (type).to_str0 ()));
+ ly_symbol2string (type).c_str ()));
}
/* if symbol then it is a context name. Scan parent contexts to
}
else
warning (_f ("pair or context-name expected for accidental rule, found %s",
- ly_scm2string (rule).to_str0 ()));
+ ly_scm2string (rule).c_str ()));
}
return number;
if (ly_is_procedure (proc))
{
- SCM kp_result = scm_call_1 (proc, scm_makfrom0str (name.to_str0 ()));
+ SCM kp_result = scm_call_1 (proc, scm_makfrom0str (name.c_str ()));
if (scm_is_string (kp_result))
return ly_scm2string (kp_result);
}
Open_type_font *
All_font_metrics::find_otf (String name)
{
- SCM sname = ly_symbol2scm (name.to_str0 ());
- SCM name_string = scm_makfrom0str (name.to_str0 ());
+ SCM sname = ly_symbol2scm (name.c_str ());
+ SCM name_string = scm_makfrom0str (name.c_str ());
SCM val;
if (!otf_dict_->try_retrieve (sname, &val))
{
String file_name;
- if (file_name.is_empty ())
+ if (file_name.empty ())
file_name = search_path_.find (name + ".otf");
- if (file_name.is_empty ())
+ if (file_name.empty ())
return 0;
if (be_verbose_global)
Tex_font_metric *
All_font_metrics::find_tfm (String name)
{
- SCM sname = ly_symbol2scm (name.to_str0 ());
- SCM name_string = scm_makfrom0str (name.to_str0 ());
+ SCM sname = ly_symbol2scm (name.c_str ());
+ SCM name_string = scm_makfrom0str (name.c_str ());
SCM val;
if (!tfm_dict_->try_retrieve (sname, &val))
{
String file_name;
- if (file_name.is_empty ())
+ if (file_name.empty ())
{
/* FIXME: should add "cork-" prefix to lm* fonts. How to do
that, cleanly? */
file_name = p;
}
- if (file_name.is_empty ())
+ if (file_name.empty ())
file_name = search_path_.find (name + ".tfm");
- if (file_name.is_empty ())
+ if (file_name.empty ())
return 0;
if (be_verbose_global)
if (!f)
{
- warning (_f ("can't find font: `%s'", name.to_str0 ()));
+ warning (_f ("can't find font: `%s'", name.c_str ()));
warning (_ ("loading default font"));
}
if (!f)
{
- error (_f ("can't find default font: `%s'", def_name.to_str0 ()));
+ error (_f ("can't find default font: `%s'", def_name.c_str ()));
error (_f ("(search path: `%s')", search_path_.to_string ()));
error (_ ("giving up"));
}
// debug quanting
me->set_property ("quant-score",
- scm_makfrom0str (qscores[best_idx].score_card_.to_str0 ()));
+ scm_makfrom0str (qscores[best_idx].score_card_.c_str ()));
}
#endif
if (!contains (pos_str0))
return "";
- char const *begin_str0 = max (pos_str0 - 8, to_str0 ());
- char const *end_str0 = min (pos_str0 + 7, to_str0 () + length ());
+ char const *begin_str0 = max (pos_str0 - 8, c_str ());
+ char const *end_str0 = min (pos_str0 + 7, c_str () + length ());
String pre_string ((Byte const *)begin_str0, pos_str0 - begin_str0);
pre_string = String_convert::bin2hex (pre_string);
if (!contains (pos_str0))
return 0;
- return pos_str0 - to_str0 ();
+ return pos_str0 - c_str ();
}
U8
orig_string = unsmob_grob (l->get_property ("cause"))->name ();
programming_error (_f ("No spacing entry from %s to `%s'",
- orig_string.to_str0 (),
- sym_string.to_str0 ()));
+ orig_string.c_str (),
+ sym_string.c_str ()));
}
Real distance = 1.0;
str += "_change";
}
- return scm_makfrom0str (str.to_str0 ());
+ return scm_makfrom0str (str.c_str ());
}
s->suicide ();
Font_metric *fm = Font_interface::get_default_font (me);
Stencil out = fm->find_by_name (glyph);
if (out.is_empty ())
- me->warning (_f ("clef `%s' not found", glyph.to_str0 ()));
+ me->warning (_f ("clef `%s' not found", glyph.c_str ()));
return out.smobbed_copy ();
}
out.add_stencil (Lookup::round_filled_polygon (points, blotdiameter));
}
else
- me->warning (_f ("unknown cluster style `%s'", shape.to_str0 ()));
+ me->warning (_f ("unknown cluster style `%s'", shape.c_str ()));
return out;
}
{
if (!get_translator (sym))
error (_f ("program has no such type: `%s'",
- ly_symbol2string (sym).to_str0 ()));
+ ly_symbol2string (sym).c_str ()));
else
translator_mods_ = scm_cons (scm_list_2 (tag, sym), translator_mods_);
}
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return scm_makfrom0str (tr->id_string ().to_str0 ());
+ return scm_makfrom0str (tr->id_string ().c_str ());
}
LY_DEFINE (ly_context_name, "ly:context-name",
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return ly_symbol2scm (tr->context_name ().to_str0 ());
+ return ly_symbol2scm (tr->context_name ().c_str ());
}
LY_DEFINE (ly_context_grob_definition, "ly:context-grob-definition",
else
{
warning (_f ("can't find or create new `%s'",
- ly_symbol2string (n).to_str0 ()));
+ ly_symbol2string (n).c_str ()));
ret = 0;
}
return ret;
else
{
warning (_f ("can't find or create `%s' called `%s'",
- ly_symbol2string (n).to_str0 (), id));
+ ly_symbol2string (n).c_str (), id));
ret = 0;
}
return ret;
Context_def *t = unsmob_context_def (st);
if (!t)
{
- warning (_f ("can't find or create: `%s'", name.to_str0 ()));
+ warning (_f ("can't find or create: `%s'", name.c_str ()));
t = unsmob_context_def (this->definition_);
}
scm_display (d->get_context_name (), port);
}
- if (!sc->id_string_.is_empty ())
+ if (!sc->id_string_.empty ())
{
scm_puts ("=", port);
- scm_puts (sc->id_string_.to_str0 (), port);
+ scm_puts (sc->id_string_.c_str (), port);
}
scm_puts (" ", port);
Duration *r = (Duration *) SCM_CELL_WORD_1 (s);
scm_puts ("#<Duration ", port);
- scm_display (scm_makfrom0str (r->to_string ().to_str0 ()), port);
+ scm_display (scm_makfrom0str (r->to_string ().c_str ()), port);
scm_puts (" >", port);
return 1;
else if (start_type == "CrescendoEvent")
start_type = "crescendo";
- SCM s = get_property ((start_type + "Spanner").to_str0 ());
+ SCM s = get_property ((start_type + "Spanner").c_str ());
if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin"))
{
cresc_ = make_spanner ("Hairpin", accepted_spanevents_drul_[START]->self_scm ());
cresc_ = make_spanner ("DynamicTextSpanner", accepted_spanevents_drul_[START]->self_scm ());
cresc_->set_property ("style", s);
context ()->set_property ((start_type
- + "Spanner").to_str0 (), SCM_EOL);
- s = get_property ((start_type + "Text").to_str0 ());
+ + "Spanner").c_str (), SCM_EOL);
+ s = get_property ((start_type + "Text").c_str ());
/*
FIXME: use get_markup () to check type.
*/
{
cresc_->set_property ("edge-text",
scm_cons (s, scm_makfrom0str ("")));
- context ()->set_property ((start_type + "Text").to_str0 (),
+ context ()->set_property ((start_type + "Text").c_str (),
SCM_EOL);
}
}
FcValue val;
val.type = FcTypeString;
- val.u.s = (const FcChar8*)ly_scm2string (name).to_str0 (); // FC_SLANT_ITALIC;
+ val.u.s = (const FcChar8*)ly_scm2string (name).c_str (); // FC_SLANT_ITALIC;
FcPatternAdd(pat, FC_FAMILY, val, FcFalse);
FcResult result;
for (int i = 0; i < dirs.size (); i++)
{
String dir = dirs[i];
- if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.to_str0 ()))
- error (_f ("adding font directory: %s", dir.to_str0 ()));
+ if (!FcConfigAppFontAddDir (font_config_global, (FcChar8 *)dir.c_str ()))
+ error (_f ("adding font directory: %s", dir.c_str ()));
else if (be_verbose_global)
- message (_f ("adding font directory: %s", dir.to_str0 ()));
+ message (_f ("adding font directory: %s", dir.c_str ()));
}
FcConfigBuildFonts (font_config_global);
Font_metric *fm = unsmob_metrics (font);
SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
- return scm_makfrom0str (fm->font_name ().to_str0 ());
+ return scm_makfrom0str (fm->font_name ().c_str ());
}
LY_DEFINE (ly_font_magnification, "ly:font-magnification", 1, 0, 0,
{
expr = scm_list_3 (ly_symbol2scm ("named-glyph"),
self_scm (),
- scm_makfrom0str (s.to_str0 ()));
+ scm_makfrom0str (s.c_str ()));
b = get_indexed_char (idx);
}
{
SCM lst = scm_list_3 (ly_symbol2scm ("text"),
this->self_scm (),
- scm_makfrom0str (str.to_str0 ()));
+ scm_makfrom0str (str.c_str ()));
Box b = text_dimension (str);
return Stencil (b, lst);
+ "\n" + doc;
scm_set_procedure_property_x (func, ly_symbol2scm ("documentation"),
- scm_makfrom0str (s.to_str0 ()));
+ scm_makfrom0str (s.c_str ()));
SCM entry = scm_cons (scm_makfrom0str (varlist), scm_makfrom0str (doc));
scm_hashq_set_x (doc_hash_table, ly_symbol2scm (fname), entry);
}
String nm = ly_scm2string (name);
String file_name = global_path.find (nm);
- if (file_name.is_empty ())
+ if (file_name.empty ())
return SCM_BOOL_F;
- return scm_makfrom0str (file_name.to_str0 ());
+ return scm_makfrom0str (file_name.c_str ());
}
/*
0, 0, 0, (),
"Return name of output backend.")
{
- return scm_makfrom0str (output_backend_global.to_str0 ());
+ return scm_makfrom0str (output_backend_global.c_str ());
}
LY_DEFINE (ly_output_formats, "ly:output-formats",
SCM lst = SCM_EOL;
int output_formats_count = output_formats.size ();
for (int i = 0; i < output_formats_count; i++)
- lst = scm_cons (scm_makfrom0str (output_formats[i].to_str0 ()), lst);
+ lst = scm_cons (scm_makfrom0str (output_formats[i].c_str ()), lst);
return lst;
}
0, 0, 0, (),
"Return effective prefix.")
{
- return scm_makfrom0str (prefix_directory.to_str0 ());
+ return scm_makfrom0str (prefix_directory.c_str ());
}
LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",
{
if (prefix_set & mask)
{
- if (!str->is_empty ())
+ if (!str->empty ())
*str += ", ";
*str += name;
}
if (iface == SCM_BOOL_F)
{
String msg = to_string (_f ("Unknown interface `%s'",
- ly_symbol2string (scm_car (ifs)).to_str0 ()));
+ ly_symbol2string (scm_car (ifs)).c_str ()));
programming_error (msg);
continue;
}
if (!found)
{
String str = to_string (_f ("Grob `%s' has no interface for property `%s'",
- me->name ().to_str0 (),
- ly_symbol2string (sym).to_str0 ()));
+ me->name ().c_str (),
+ ly_symbol2string (sym).c_str ()));
programming_error (str);
}
}
Grob *sc = (Grob *) SCM_CELL_WORD_1 (s);
scm_puts ("#<Grob ", port);
- scm_puts ((char *) sc->name ().to_str0 (), port);
+ scm_puts ((char *) sc->name ().c_str (), port);
/* Do not print properties, that is too much hassle. */
scm_puts (" >", port);
*/
#include "hairpin.hh"
-
#include "staff-symbol-referencer.hh"
#include "line-interface.hh"
#include "spanner.hh"
msg += "\n";
msg += _f ("(search path: `%s')",
sources->path_->to_string ().c_str ());
- LexerError (msg.to_str0 ());
+ LexerError (msg.c_str ());
return;
}
file_name_strings_.push (file->name_string ());
{
if (include_stack_.is_empty ())
return 0;
- return include_stack_.top ()->to_str0 () + char_count_stack_.top ();
+ return include_stack_.top ()->c_str () + char_count_stack_.top ();
}
Includable_lexer::~Includable_lexer ()
virtual ~Source_file ();
- char const *to_str0 () const;
+ char const *c_str () const;
virtual String quote_input (char const *pos_str0) const;
istream *get_istream ();
bool contains (char const *pos_str0) const;
int l, ch, col;
ip->get_counts (&l, &ch, &col);
- return scm_list_4 (scm_makfrom0str (ip->file_string ().to_str0 ()),
+ return scm_list_4 (scm_makfrom0str (ip->file_string ().c_str ()),
scm_from_int (l),
scm_from_int (ch),
scm_from_int (col));
{
Input *ip = unsmob_input (sip);
SCM_ASSERT_TYPE (ip, sip, SCM_ARG1, __FUNCTION__, "input location");
- return scm_list_5 (scm_makfrom0str (ip->file_string ().to_str0 ()),
+ return scm_list_5 (scm_makfrom0str (ip->file_string ().c_str ()),
scm_from_int (ip->line_number ()),
scm_from_int (ip->column_number ()),
scm_from_int (ip->end_line_number ()),
print_smob (SCM s, SCM port, scm_print_state *)
{
String str = "#<location " + unsmob_input (s)->location_string () + ">";
- scm_puts (str.to_str0 (), port);
+ scm_puts (str.c_str (), port);
return 1;
}
yy_pop_state ();
this->here_input().get_source_file ()->name_ = s;
- message (_f ("Renaming input to: `%s'", s.to_str0 ()));
+ message (_f ("Renaming input to: `%s'", s.c_str ()));
progress_indication ("\n");
scm_module_define (scm_car (scopes_),
ly_symbol2scm ("input-file-name"),
- scm_makfrom0str (s.to_str0 ()));
+ scm_makfrom0str (s.c_str ()));
}
<version>. {
} else {
String msg (_f ("wrong or undefined identifier: `%s'", s ));
- LexerError (msg.to_str0 ());
+ LexerError (msg.c_str ());
SCM err = scm_current_error_port ();
scm_puts ("This value was found in the table: ", err);
scm_display (sid, err);
/* yylval is union. Must remember STRING before setting SCM*/
String *sp = yylval.string;
- yylval.scm = scm_makfrom0str (sp->to_str0 ());
+ yylval.scm = scm_makfrom0str (sp->c_str ());
delete sp;
return STRING;
}
/* yylval is union. Must remember STRING before setting SCM*/
String *sp = yylval.string;
- yylval.scm = scm_makfrom0str (sp->to_str0 ());
+ yylval.scm = scm_makfrom0str (sp->c_str ());
delete sp;
return LYRICS_STRING;
}
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.to_str0 ());
+ yylval.scm = scm_makfrom0str (s.c_str ());
return LYRICS_STRING;
if (c == '{' || c == '}')
here_input ().warning (
_ ("Brace found at end of markup. Did you forget a space?"));
- yylval.scm = scm_makfrom0str (s.to_str0 ());
+ yylval.scm = scm_makfrom0str (s.c_str ());
return STRING;
<*>. {
String msg = _f ("invalid character: `%c'", YYText ()[0]);
- LexerError (msg.to_str0 ());
+ LexerError (msg.c_str ());
return YYText ()[0];
}
{
// use more SCM for this.
-// SCM sym = ly_symbol2scm (str.to_str0 ());
+// SCM sym = ly_symbol2scm (str.c_str ());
int i = lookup_keyword (str);
if (i == MARKUP && is_lyric_state ())
}
String msg (_f ("unknown escaped string: `\\%s'", str));
- LexerError (msg.to_str0 ());
+ LexerError (msg.c_str ());
- yylval.scm = scm_makfrom0str (str.to_str0 ());
+ yylval.scm = scm_makfrom0str (str.c_str ());
return STRING;
}
int
Lily_lexer::scan_bare_word (String str)
{
- SCM sym = ly_symbol2scm (str.to_str0 ());
+ SCM sym = ly_symbol2scm (str.c_str ());
if ((YYSTATE == notes) || (YYSTATE == chords)) {
SCM handle = SCM_BOOL_F;
if (scm_is_pair (pitchname_tab_stack_))
}
}
- yylval.scm = scm_makfrom0str (str.to_str0 ());
+ yylval.scm = scm_makfrom0str (str.c_str ());
return STRING;
}
lookup_markup_command (String s)
{
SCM proc = ly_lily_module_constant ("lookup-markup-command");
- return scm_call_1 (proc, scm_makfrom0str (s.to_str0 ()));
+ return scm_call_1 (proc, scm_makfrom0str (s.c_str ()));
}
{
SCM s = SCM_EOL;
for (int i = a.size () - 1; i >= 0; i--)
- s = scm_cons (ly_symbol2scm (a[i].to_str0 ()), s);
+ s = scm_cons (ly_symbol2scm (a[i].c_str ()), s);
return s;
}
if (type != SCM_EOL && !ly_is_procedure (type))
{
warning (_f ("can't find property type-check for `%s' (%s).",
- ly_symbol2string (sym).to_str0 (),
- ly_symbol2string (type_symbol).to_str0 ())
+ ly_symbol2string (sym).c_str (),
+ ly_symbol2string (type_symbol).c_str ())
+ " " + _ ("perhaps a typing error?"));
/* Be strict when being anal :) */
SCM type_name = scm_call_1 (typefunc, type);
warning (_f ("type check for `%s' failed; value `%s' must be of type `%s'",
- ly_symbol2string (sym).to_str0 (),
+ ly_symbol2string (sym).c_str (),
print_scm_val (val),
- ly_scm2string (type_name).to_str0 ()));
+ ly_scm2string (type_name).c_str ()));
progress_indication ("\n");
}
}
int
Lily_lexer::lookup_keyword (String s)
{
- return keytable_->lookup (s.to_str0 ());
+ return keytable_->lookup (s.c_str ());
}
SCM
SCM
Lily_lexer::lookup_identifier (String name)
{
- return lookup_identifier_symbol (ly_symbol2scm (name.to_str0 ()));
+ return lookup_identifier_symbol (ly_symbol2scm (name.c_str ()));
}
void
scm_module_define (scm_car (scopes_),
ly_symbol2scm ("input-file-name"),
- scm_makfrom0str (main_input_name_.to_str0 ()));
+ scm_makfrom0str (main_input_name_.c_str ()));
}
void
if (lookup_keyword (ly_symbol2string (sym)) >= 0)
{
String symstr = ly_symbol2string (sym);
- warning (_f ("identifier name is a keyword: `%s'", symstr.to_str0 ()));
+ warning (_f ("identifier name is a keyword: `%s'", symstr.c_str ()));
}
SCM mod = scm_car (scopes_);
out_file_name.dir_ = "";
/* When running from gui, generate output in .ly source directory. */
- if (output_name_global.is_empty ()
+ if (output_name_global.empty ()
&& ly_get_option (ly_symbol2scm ("gui")) == SCM_BOOL_T)
{
File_name f (file);
output_name_global = f.to_string ();
}
- if (!output_name_global.is_empty ())
+ if (!output_name_global.empty ())
{
/* Interpret --output=DIR to mean --output=DIR/BASE. */
if (is_dir (output_name_global))
{
global_path.prepend (cwd);
message (_f ("Changing working directory to `%s'",
- output_name_global.to_str0 ()));
- chdir (output_name_global.to_str0 ());
+ output_name_global.c_str ()));
+ chdir (output_name_global.c_str ());
}
output_name_global = "";
}
}
String init;
- if (!init_name_global.is_empty ())
+ if (!init_name_global.empty ())
init = init_name_global;
else
init = "init.ly";
sources.set_path (&global_path);
String mapped_fn = map_file_name (file_name);
- message (_f ("Processing `%s'", mapped_fn.to_str0 ()));
+ message (_f ("Processing `%s'", mapped_fn.c_str ()));
progress_indication ("\n");
Lily_parser *parser = new Lily_parser (&sources);
if (error)
/* TODO: pass renamed input file too. */
scm_throw (ly_symbol2scm ("ly-file-failed"),
- scm_list_1 (scm_makfrom0str (file_name.to_str0 ())));
+ scm_list_1 (scm_makfrom0str (file_name.c_str ())));
}
return SCM_UNSPECIFIED;
}
Lily_parser *p = unsmob_lily_parser (parser);
SCM_ASSERT_TYPE (p, parser, SCM_ARG1, __FUNCTION__, "Lilypond parser");
- return scm_makfrom0str (p->output_basename_.to_str0 ());
+ return scm_makfrom0str (p->output_basename_.c_str ());
}
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.to_str0 ()));
+ scm_eval_string (scm_makfrom0str (s.c_str ()));
/* Read .ly IN_FILE, lex, parse, write \score blocks from IN_FILE to
OUT_FILE (unless IN_FILE redefines output file name). */
void
Lily_parser::parser_error (String s)
{
- lexer_->here_input ().error (_ (s.to_str0 ()));
+ lexer_->here_input ().error (_ (s.c_str ()));
error_level_ = 1;
}
{
return scm_list_4 (context_ ? context_->self_scm () : SCM_BOOL_F,
creation_moment_.smobbed_copy (),
- scm_makfrom0str (grob_name_.to_str0 ()),
+ scm_makfrom0str (grob_name_.c_str ()),
scm_from_int (disambiguation_count_));
}
{
return scm_list_5 (parent_context_ ? parent_context_->self_scm () : SCM_BOOL_F,
start_moment_.smobbed_copy (),
- scm_makfrom0str (context_name_.to_str0 ()),
- scm_makfrom0str (id_.to_str0 ()),
+ scm_makfrom0str (context_name_.c_str ()),
+ scm_makfrom0str (id_.c_str ()),
scm_from_int (disambiguation_count_));
}
Lilypond_general_key::as_scheme () const
{
return scm_list_3 (parent_ ? parent_->self_scm () : SCM_BOOL_F,
- scm_makfrom0str (name_.to_str0 ()),
+ scm_makfrom0str (name_.c_str ()),
scm_from_int (disambiguation_count_));
}
env_var_info (out, "LILYPONDPREFIX");
fprintf (out, "LOCALEDIR=\"%s\"\n", LOCALEDIR);
- fprintf (out, "\nEffective prefix: \"%s\"\n", prefix_directory.to_str0 ());
+ fprintf (out, "\nEffective prefix: \"%s\"\n", prefix_directory.c_str ());
if (relocate_binary)
{
all_fonts_global = new All_font_metrics (global_path.to_string ());
- if (!init_scheme_variables.is_empty ()
- || !init_scheme_code_string.is_empty ())
+ if (!init_scheme_variables.empty ()
+ || !init_scheme_code_string.empty ())
{
init_scheme_variables = "(map (lambda (x) (ly:set-option (car x) (cdr x))) (list "
+ init_scheme_variables + "))";
option_parser = 0;
#if HAVE_CHROOT
- if (!jail_spec.is_empty ())
+ if (!jail_spec.empty ())
do_chroot_jail ();
#endif
UGH. don't use eval.
*/
SCM proc = ly_lily_module_constant ("midi-program");
- SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.to_str0 ()));
+ SCM program = scm_call_1 (proc, ly_symbol2scm (audio_->str_.c_str ()));
found = (program != SCM_BOOL_F);
if (found)
program_byte = scm_to_int (program);
else
- warning (_f ("no such MIDI instrument: `%s'", audio_->str_.to_str0 ()));
+ warning (_f ("no such MIDI instrument: `%s'", audio_->str_.c_str ()));
String str = ::to_string ((char) (0xc0 + channel_)); //YIKES! FIXME : Should be track. -rz
str += ::to_string ((char)program_byte);
Midi_stream::Midi_stream (String file_name)
{
file_name_string_ = file_name;
- out_file_ = fopen (file_name.to_str0 (), "wb");
+ out_file_ = fopen (file_name.c_str (), "wb");
if (!out_file_)
error (_f ("can't open for write: %s: %s", file_name, strerror (errno)));
}
Box
Modified_font_metric::text_dimension (String text) const
{
- SCM stext = scm_makfrom0str (text.to_str0 ());
+ SCM stext = scm_makfrom0str (text.c_str ());
Box b = lookup_tex_text_dimension (orig_, stext);
if (!b[Y_AXIS].is_empty ())
{
scm_puts ("#<Mom ", port);
String str = r->to_string ();
- scm_puts ((char *)str.to_str0 (), port);
+ scm_puts ((char *)str.c_str (), port);
scm_puts (">", port);
return 1;
signature);
scm_set_object_property_x (func, ly_symbol2scm ("music-function-signature-keyword"),
- ly_symbol2scm (str.to_str0 ()));
+ ly_symbol2scm (str.c_str ()));
SCM_RETURN_NEWSMOB (music_function_tag, func);
}
name = ly_scm2string (voice_name);
get_music ()->origin ()->warning (_f ("cannot find Voice `%s'",
- name.to_str0 ()) + "\n");
+ name.c_str ()) + "\n");
}
if (lyric_iter_)
if (out.is_empty ())
{
- me->warning (_f ("note head `%s' not found", idx.to_str0 ()));
+ me->warning (_f ("note head `%s' not found", idx.c_str ()));
out = Stencil (Box (Interval (0, 0), Interval (0, 0)), SCM_EOL);
}
else
if (s.length ())
{
Item *t = make_item ("NoteName", events_[0]->self_scm ());
- t->set_property ("text", scm_makfrom0str (s.to_str0 ()));
+ t->set_property ("text", scm_makfrom0str (s.c_str ()));
texts_.push (t);
}
}
char ctag [5] = " ";
String tag_string = ly_scm2string (tag);
- strncpy (ctag, tag_string.to_str0 (), tag_string.length ());
+ strncpy (ctag, tag_string.c_str (), tag_string.length ());
String tab = otf->get_otf_table (String (ctag));
String contents ((Byte const *)buffer, length);
contents = "(quote (" + contents + "))";
- tab = scm_c_eval_string (contents.to_str0 ());
+ tab = scm_c_eval_string (contents.c_str ());
free (buffer);
}
return tab;
get_otf_table (FT_Face face, String tag)
{
FT_ULong len;
- FT_Byte *tab = load_table (tag.to_str0 (), face, &len);
+ FT_Byte *tab = load_table (tag.c_str (), face, &len);
return String (tab, len);
}
open_ft_face (String str)
{
FT_Face face;
- int error_code = FT_New_Face (freetype2_library, str.to_str0 (), 0, &face);
+ int error_code = FT_New_Face (freetype2_library, str.c_str (), 0, &face);
if (error_code == FT_Err_Unknown_File_Format)
- error (_f ("unsupported font format: %s", str.to_str0 ()));
+ error (_f ("unsupported font format: %s", str.c_str ()));
else if (error_code)
error (_f ("unknown error: %d reading font file: %s", error_code,
- str.to_str0 ()));
+ str.c_str ()));
return face;
}
Offset
Open_type_font::attachment_point (String glyph_name) const
{
- SCM sym = ly_symbol2scm (glyph_name.to_str0 ());
+ SCM sym = ly_symbol2scm (glyph_name.c_str ());
SCM entry = scm_hashq_ref (lily_character_table_, sym, SCM_BOOL_F);
Offset o;
int
Open_type_font::name_to_index (String nm) const
{
- char *nm_str = (char *) nm.to_str0 ();
+ char *nm_str = (char *) nm.c_str ();
if (int idx = FT_Get_Name_Index (face_, nm_str))
return idx;
return -1;
SCM
Output_def::c_variable (String s) const
{
- return lookup_variable (ly_symbol2scm (s.to_str0 ()));
+ return lookup_variable (ly_symbol2scm (s.c_str ()));
}
void
Pango_font::register_font_file (String filename, String ps_name)
{
scm_hash_set_x (physical_font_tab_,
- scm_makfrom0str (ps_name.to_str0 ()),
- scm_makfrom0str (filename.to_str0 ()));
+ scm_makfrom0str (ps_name.c_str ()),
+ scm_makfrom0str (filename.c_str ()));
}
void
PangoAnalysis const *pa = &(item->analysis);
PangoGlyphString *pgs = pango_glyph_string_new ();
- pango_shape (str.to_str0 () + item->offset,
+ pango_shape (str.c_str () + item->offset,
item->length, (PangoAnalysis*) pa, pgs);
PangoRectangle logical_rect;
pango_fc_font_unlock_face (fcfont);
SCM expr = scm_list_5 (ly_symbol2scm ("glyph-string"),
- scm_makfrom0str (ps_name.to_str0 ()),
+ scm_makfrom0str (ps_name.c_str ()),
scm_from_double (size),
scm_from_bool (cid_keyed),
ly_quote_scm (glyph_exprs));
{
GList *items
= pango_itemize (context_,
- str.to_str0 (),
+ str.c_str (),
0, str.length (), attribute_list_,
NULL);
SCM exp
= scm_list_3 (ly_symbol2scm ("utf-8-string"),
scm_makfrom0str (descr_string),
- scm_makfrom0str (str.to_str0 ()));
+ scm_makfrom0str (str.c_str ()));
g_free (descr_string);
if (scm_is_string (name))
{
String name_str = ly_scm2string (name);
- description = pango_font_description_from_string (name_str.to_str0 ());
+ description = pango_font_description_from_string (name_str.c_str ());
}
else
{
family_str = ly_scm2string (family);
pango_font_description_set_family (description,
- family_str.to_str0 ());
+ family_str.c_str ());
pango_font_description_set_style (description,
symbol_to_pango_style (style));
pango_font_description_set_variant (description,
SCM fields = SCM_EOL;
for (int i = dump_header_fieldnames_global.size (); i--;)
fields
- = scm_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()),
+ = scm_cons (ly_symbol2scm (dump_header_fieldnames_global[i].c_str ()),
fields);
return fields;
}
String mod_nm = "scm framework-" + output_backend_global;
- SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
+ SCM mod = scm_c_resolve_module (mod_nm.c_str ());
if (make_print)
{
SCM func = scm_c_module_lookup (mod, "output-framework");
String format = output_backend_global;
String mod_nm = "scm framework-" + format;
- SCM mod = scm_c_resolve_module (mod_nm.to_str0 ());
+ SCM mod = scm_c_resolve_module (mod_nm.c_str ());
SCM func = scm_c_module_lookup (mod, "output-classic-framework");
func = scm_variable_ref (func);
SCM scm_mol = Text_interface::interpret_markup (me->layout ()->self_scm (),
properties,
- scm_makfrom0str (r.to_str0 ()));
+ scm_makfrom0str (r.c_str ()));
SCM when_mol = Text_interface::interpret_markup (me->layout ()->self_scm (),
properties,
- scm_makfrom0str (when.to_str0 ()));
+ scm_makfrom0str (when.c_str ()));
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);
output_name = ly_scm2string (port_name);
message (_f ("Layout output to `%s'...",
- output_name.to_str0 ()));
+ output_name.c_str ()));
progress_indication ("\n");
Paper_outputter *po = new Paper_outputter (port, f);
smobify_self ();
String module_name = "scm output-" + format;
- output_module_ = scm_c_resolve_module (module_name.to_str0 ());
+ output_module_ = scm_c_resolve_module (module_name.c_str ());
}
Paper_outputter::~Paper_outputter ()
return scm_cdr (s);
s = scm_sloppy_assq (sym, immutable_property_alist_);
-
-
return (s == SCM_BOOL_F) ? SCM_EOL : scm_cdr (s);
}
Source_file *sf = ps->start_location_.get_source_file ();
SCM port = sf->get_port ();
- int off = ps->start_location_.start () - sf->to_str0 ();
+ int off = ps->start_location_.start () - sf->c_str ();
scm_seek (port, scm_long2num (off), scm_long2num (SEEK_SET));
SCM from = scm_ftell (port);
is_regular_identifier (SCM id)
{
String str = ly_scm2string (id);
- char const *s = str.to_str0 ();
+ char const *s = str.c_str ();
bool v = true;
#if 0
{
String nm = p->name_ + String ("Event");
if (ly_is_equal (m->get_property ("name"),
- scm_str2symbol (nm.to_str0 ())))
+ scm_str2symbol (nm.c_str ())))
{
Direction d = to_dir (m->get_property ("span-direction"));
p->event_drul_[d] = m;
{
String name = String (p->name_) + "PedalLineSpanner";
Music *rq = (p->event_drul_[START] ? p->event_drul_[START] : p->event_drul_[STOP]);
- p->line_spanner_ = make_spanner (name.to_str0 (), rq->self_scm ());
+ p->line_spanner_ = make_spanner (name.c_str (), rq->self_scm ());
}
/* Choose the appropriate grobs to add to the line spanner
*/
String prop = String ("pedal") + p->name_ + "Style";
- SCM style = get_property (prop.to_str0 ());
+ SCM style = get_property (prop.c_str ());
bool mixed = style == ly_symbol2scm ("mixed");
bool bracket = (mixed
Piano_pedal_engraver::create_text_grobs (Pedal_info *p, bool mixed)
{
SCM s = SCM_EOL;
- SCM strings = get_property (("pedal" + String (p->name_) + "Strings").to_str0 ());
+ SCM strings = get_property (("pedal" + String (p->name_) + "Strings").c_str ());
if (scm_ilength (strings) < 3)
{
{
String propname = String (p->name_) + "Pedal";
- p->item_ = make_item (propname.to_str0 (), (p->event_drul_[START]
+ p->item_ = make_item (propname.c_str (), (p->event_drul_[START]
? p->event_drul_[START]
: p->event_drul_[STOP])->self_scm ());
{
String nm = p->name_ + String ("Event");
if (ly_is_equal (r->get_property ("name"),
- scm_str2symbol (nm.to_str0 ())))
+ scm_str2symbol (nm.c_str ())))
{
Direction d = to_dir (r->get_property ("span-direction"));
p->event_drul_[d] = r;
{
Pitch *r = (Pitch *) SCM_CELL_WORD_1 (s);
scm_puts ("#<Pitch ", port);
- scm_display (scm_makfrom0str (r->to_string ().to_str0 ()), port);
+ scm_display (scm_makfrom0str (r->to_string ().c_str ()), port);
scm_puts (" >", port);
return 1;
}
"Print ly:set-option usage")
{
String help = get_help_string ();
- fputs (help.to_str0 (), stdout);
+ fputs (help.c_str (), stdout);
exit (0);
return SCM_UNSPECIFIED;
String varstr = ly_scm2string (scm_symbol_to_string (var));
if (varstr.left_string (3) == String ("no-"))
{
- var = ly_symbol2scm (varstr.nomid_string (0, 3).to_str0 ());
+ var = ly_symbol2scm (varstr.nomid_string (0, 3).c_str ());
val = scm_from_bool (!to_boolean (val));
}
SCM handle = scm_hashq_get_handle (option_hash, var);
if (handle == SCM_BOOL_F)
- warning (_f ("no such internal option: %s", varstr.to_str0 ()));
+ warning (_f ("no such internal option: %s", varstr.c_str ()));
internal_set_option (var, val);
return SCM_UNSPECIFIED;
if (overwrite || !getenv (key))
{
String combine = String (key) + "=" + value;
- char *s = strdup (combine.to_str0 ());
+ char *s = strdup (combine.c_str ());
return putenv (s);
}
if (is_dir (value))
{
if (be_verbose_global)
- progress_indication (_f ("%s=%s\n", key, value.to_str0 ()));
+ progress_indication (_f ("%s=%s\n", key, value.c_str ()));
if (char const *cur = getenv (key))
value += to_string (PATHSEP) + cur;
- return sane_putenv (key, value.to_str0 (), true);
+ return sane_putenv (key, value.c_str (), true);
}
else if (be_verbose_global)
warning (_f ("no such directory: %s for %s", value, key));
if (be_verbose_global)
warning (_f ("Relocation: compile prefix=%s, new prefix=%s",
prefix_directory,
- prefix.to_str0 ()));
+ prefix.c_str ()));
String bindir = prefix + "/bin";
String datadir = prefix + "/share";
#if HAVE_GETTEXT
if (is_dir (localedir))
- bindtextdomain ("lilypond", localedir.to_str0 ());
+ bindtextdomain ("lilypond", localedir.c_str ());
#endif
prepend_env_path ("PATH", bindir);
argv0_abs = path.find (argv0_filename.to_string (), ext);
#endif /* __MINGW32__ */
- if (argv0_abs.is_empty ())
+ if (argv0_abs.empty ())
programming_error ("can't find absolute argv0.");
}
struct stat statbuf;
String build_prefix = prefix_directory + "/share/lilypond/" TOPLEVEL_VERSION;
- if (stat (build_prefix.to_str0 (), &statbuf) == 0)
+ if (stat (build_prefix.c_str (), &statbuf) == 0)
prefix_directory = build_prefix;
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.to_str0 ()));
+ context ()->set_property ("whichBar", scm_makfrom0str (s.c_str ()));
}
}
is_ledgered |= (balltype == 1) && (pos <= -rad - 2 || pos > +rad);
}
- String actual_style (style.to_str0 ());
+ String actual_style (style.c_str ());
if ((style == "mensural") || (style == "neomensural"))
{
String font_char = glyph_name (me, balltype, style, ledgered);
Stencil out = fm->find_by_name (font_char);
if (out.is_empty ())
- me->warning (_f ("rest `%s' not found", font_char.to_str0 ()));
+ me->warning (_f ("rest `%s' not found", font_char.c_str ()));
return out.smobbed_copy ();
}
{
String msg
= String_convert::form_string ("Improbable offset for grob %s: %f%s",
- me->name ().to_str0 (), total_off,
+ me->name ().c_str (), total_off,
INTERNAL_UNIT);
programming_error (msg);
/* if create_separate_contexts_ is set, create a new context with the
number number as name */
- SCM name = ly_symbol2scm (get_outlet ()->context_name ().to_str0 ());
+ SCM name = ly_symbol2scm (get_outlet ()->context_name ().c_str ());
Context *t = (j && create_separate_contexts_)
? get_outlet ()->find_create_context (name, to_string (j), SCM_EOL)
: get_outlet ();
// debug quanting
slur_->set_property ("quant-score",
- scm_makfrom0str (configurations_[opt_idx]->score_card_.to_str0 ()));
+ scm_makfrom0str (configurations_[opt_idx]->score_card_.c_str ()));
#endif
{
/* "b" must ensure to open literally, avoiding text (CR/LF)
conversions. */
- FILE *f = fopen (filename.to_str0 (), "rb");
+ FILE *f = fopen (filename.c_str (), "rb");
if (!f)
{
- warning (_f ("can't open file: `%s'", filename.to_str0 ()));
+ warning (_f ("can't open file: `%s'", filename.c_str ()));
return 0;
}
istream_ = 0;
contents_str0_ = data.get_copy_str0 ();
length_ = data.length ();
- pos_str0_ = to_str0 ();
+ pos_str0_ = c_str ();
init_port ();
for (int i = 0; i < length_; i++)
contents_str0_ = gulp_file (filename_string, &length_);
}
- pos_str0_ = to_str0 ();
+ pos_str0_ = c_str ();
init_port ();
if (!istream_)
{
if (length ()) // can-t this be done without such a hack?
- istream_ = new istringstream (to_str0 ());
+ istream_ = new istringstream (c_str ());
else
{
istream_ = new istringstream ("");
String
Source_file::file_line_column_string (char const *context_str0) const
{
- if (!to_str0 ())
+ if (!c_str ())
return " (" + _ ("position unknown") + ")";
else
{
if (!contains (pos_str0))
return Slice (0, 0);
- char const *data_str0 = to_str0 ();
+ char const *data_str0 = c_str ();
char const *eof_C_ = data_str0 + length ();
if (pos_str0 == eof_C_)
return "";
Slice line = line_slice (pos_str0);
- char const *data_str0 = to_str0 ();
+ char const *data_str0 = c_str ();
return String ((Byte const *)data_str0 + line[LEFT], line.length ());
}
*line_number = get_line (pos_str0);
Slice line = line_slice (pos_str0);
- char const *data = to_str0 ();
+ char const *data = c_str ();
Byte const *line_start = (Byte const *)data + line[LEFT];
int left = (Byte const *) pos_str0 - line_start;
String line_begin (line_start, left);
- char const *line_chars = line_begin.to_str0 ();
+ char const *line_chars = line_begin.c_str ();
*column = 0;
*line_char = 0;
bool
Source_file::contains (char const *pos_str0) const
{
- return (pos_str0 && (pos_str0 >= to_str0 ()) && (pos_str0 <= to_str0 () + length ()));
+ return (pos_str0 && (pos_str0 >= c_str ()) && (pos_str0 <= c_str () + length ()));
}
int
}
char const *
-Source_file::to_str0 () const
+Source_file::c_str () const
{
return contents_str0_;
}
char const *
Source_file::seek_str0 (int n)
{
- char const *new_str0 = to_str0 () + n;
+ char const *new_str0 = c_str () + n;
if (n < 0)
new_str0 += length ();
if (contains (new_str0))
else if (type == ":|:")
type = ".|.";
- return scm_makfrom0str (type.to_str0 ());
+ return scm_makfrom0str (type.c_str ());
}
Interval
if (!parent->spanned_rank_iv ().superset (this->spanned_rank_iv ()))
{
programming_error (to_string ("Spanner `%s' is not fully contained in parent spanner `%s'.",
- name ().to_str0 (),
- parent->name ().to_str0 ()));
+ name ().c_str (),
+ parent->name ().c_str ()));
}
}
}
{
SCM proc = ly_lily_module_constant ("percussion?");
- SCM drums = scm_call_1 (proc, ly_symbol2scm (instrument_string_.to_str0 ()));
+ SCM drums = scm_call_1 (proc, ly_symbol2scm (instrument_string_.c_str ()));
audio_staff_->channel_ = (drums == SCM_BOOL_T ? 9 : -1);
if (name_)
{
if (scm_is_string (stroke_style_scm))
{
String stroke_style = ly_scm2string (stroke_style_scm);
- if (!stroke_style.is_empty ())
+ if (!stroke_style.empty ())
{
String font_char = to_string (dir) + stroke_style;
Stencil stroke = fm->find_by_name ("flags." + font_char);
{
SCM type = scm_is_symbol (symbol_) ? symbol_ : default_type;
delimiter_ = make_spanner_from_properties (engraver, type,
- SCM_EOL, ly_symbol2string (type).to_str0 ());
+ SCM_EOL, ly_symbol2string (type).c_str ());
for (int i = 0 ; i < children_.size (); i++)
{
if (text_dimension_hash_tab)
{
scm_hash_ref (text_dimension_hash_tab,
- scm_makfrom0str (key_str.to_str0 ()),
+ scm_makfrom0str (key_str.c_str ()),
SCM_BOOL_F);
}
if (scm_is_pair (val))
String contents (gulp_file_to_string (path, true, -1));
contents = "(quote (" + contents + "))";
- SCM lst = scm_c_eval_string (contents.to_str0 ());
+ SCM lst = scm_c_eval_string (contents.c_str ());
ly_load_text_dimensions (lst);
}
}
/* Not using ngettext's plural feature here, as this message is
more of a programming error. */
error (_f ("TFM header of `%s' has only %u word (s)",
- input_.name_string ().to_str0 (), header_length));
+ input_.name_string ().c_str (), header_length));
info_.checksum = input_.get_U32 ();
info_.design_size = get_U32_fix ();
if (header_.param_word_count > TFM_MAX_FONTDIMENS)
{
warning (_f ("%s: TFM file has %u parameters, which is more than the %u I can handle",
- input_.name_string ().to_str0 (),
+ input_.name_string ().c_str (),
header_.param_word_count,
TFM_MAX_FONTDIMENS));
header_.param_word_count = TFM_MAX_FONTDIMENS;
chain);
SCM sn = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
- scm_makfrom0str (to_string (num).to_str0 ()));
+ scm_makfrom0str (to_string (num).c_str ()));
SCM sd = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
- scm_makfrom0str (to_string (den).to_str0 ()));
+ scm_makfrom0str (to_string (den).c_str ()));
Stencil n = *unsmob_stencil (sn);
Stencil d = *unsmob_stencil (sd);
global_translator_dict->try_retrieve (sym, &v);
if (v == SCM_BOOL_F)
- error (_f ("unknown translator: `%s'", ly_symbol2string (sym).to_str0 ()));
+ error (_f ("unknown translator: `%s'", ly_symbol2string (sym).c_str ()));
return unsmob_translator (v);
}
interface_name = interface_name.substitute ('_', '-');
interface_name += "-interface";
- inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.to_str0 ()));
+ inf.symbol_ = scm_gc_protect_object (ly_symbol2scm (interface_name.c_str ()));
ack_array->push (inf);
}
static void
print_body (void *out, String name)
{
- FILE *fd = fopen (name.to_str0 (), "rb");
+ FILE *fd = fopen (name.c_str (), "rb");
static char xdigits[] = "0123456789ABCDEF";
String prefs = Gregorian_ligature::prefixes_to_str (primitive);
primitive->warning (_f ("ignored prefix (es) `%s' of this head according "
"to restrictions of the selected ligature style",
- prefs.to_str0 ()));
+ prefs.c_str ()));
}
}
if (prev_primitive)
prev_primitive->set_property ("glyph-name",
- scm_makfrom0str (prev_glyph_name.to_str0 ()));
+ scm_makfrom0str (prev_glyph_name.c_str ()));
/*
* In the backend, flexa shapes and joins need to know about line
}
prev_primitive->set_property ("glyph-name",
- scm_makfrom0str (prev_glyph_name.to_str0 ()));
+ scm_makfrom0str (prev_glyph_name.c_str ()));
align_heads (primitives, flexa_width, thickness);
{
String id = i.context ()->id_string ();
- scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.to_str0 ()),
+ scm_hash_set_x (id_to_group_hashtab_, scm_makfrom0str (id.c_str ()),
i.grob ()->self_scm ());
SCM before_id = i.context ()->get_property ("alignAboveContext");
SCM spaceable = get_property ("verticallySpacedContexts");
Context *orig = gi.origin_contexts (this)[0];
- if (scm_memq (ly_symbol2scm (orig->context_name ().to_str0 ()),
+ if (scm_memq (ly_symbol2scm (orig->context_name ().c_str ()),
spaceable) != SCM_BOOL_F)
{
Pointer_group_interface::add_grob (system_,
if (done_count_ <= alt_count_)
add_repeat_command (scm_list_n (ly_symbol2scm ("volta"),
- scm_makfrom0str (repstr.to_str0 ()), SCM_UNDEFINED));
+ scm_makfrom0str (repstr.c_str ()), SCM_UNDEFINED));
}
else
add_repeat_command (ly_symbol2scm ("end-repeat"));