2006-01-23 Jan Nieuwenhuizen <janneke@gnu.org>
- * flower/include/std-string.hh: Oops, bugfix for --disable-std-string.
+ * flower/international.cc:
+ * flower/include/international.hh:
+ * flower/getopt-long.cc:
* flower/include/getopt-long.hh: Use std::string [interface].
Update callers.
+ * flower/include/std-string.hh: Oops, bugfix for --disable-std-string.
+
* stepmake/stepmake/executable-rules.make: Add dependency on
module libraries.
#ifndef INTERNATIONAL_HH
#define INTERNATIONAL_HH
-#include "string.hh"
+#include "std-string.hh"
/**
Internationalisation: _i ("to be translated") gets an entry in the POT file
/**
Internationalisation: _ ("to be translated") gets "translated" by GNU gettext
*/
-String _ (char const *ch);
+Std_string _ (char const *ch);
/**
Internationalisation: _f ("Usage: %s [FILE]", "lilypond") gets "translated" by
GNU gettext
*/
-String _f (char const *format, ...);
-String _f (char const *format, String s, String s2 = "", String s3 = "");
+Std_string _f (char const *format, ...);
+Std_string _f (char const *format, Std_string s, Std_string s2 = "", Std_string s3 = "");
#endif // INTERNATIONAL_HH
#include <libintl.h>
#endif
-String
+Std_string
_ (char const *ch)
{
- return String (gettext (ch));
+ return Std_string (gettext (ch));
}
-String
+Std_string
_f (char const *format, ...)
{
va_list args;
va_start (args, format);
- String str = String_convert::vform_string (gettext (format), args);
+ Std_string str = String_convert::vform_string (gettext (format), args);
va_end (args);
return str;
}
-String
-_f (char const *format, String s, String s2, String s3)
+Std_string
+_f (char const *format, Std_string s, Std_string s2, Std_string s3)
{
- return String_convert::form_string (gettext (format), s.to_str0 (), s2.to_str0 (),
- s3.to_str0 ());
+ return String_convert::form_string (gettext (format), s.c_str (), s2.c_str (),
+ s3.c_str ());
}
{
SCM_ASSERT_TYPE (scm_is_string (string), string, SCM_ARG1,
__FUNCTION__, "string");
- return scm_makfrom0str (_ (scm_i_string_chars (string)).to_str0 ());
+ return scm_makfrom0str (_ (scm_i_string_chars (string)).c_str ());
}
LY_DEFINE (ly_output_backend, "ly:output-backend",
{
if (!allow_includes_b_)
{
- LexerError (_ ("include files are not allowed in safe mode").to_str0 ());
+ LexerError (_ ("include files are not allowed in safe mode").c_str ());
return;
}
<INITIAL,chords,lyrics,figures,notes>{BOM_UTF8} {
if (this->lexloc->line_number () != 1 || this->lexloc->column_number () != 0)
{
- LexerError (_ ("stray UTF-8 BOM encountered").to_str0 ());
+ LexerError (_ ("stray UTF-8 BOM encountered").c_str ());
exit (1);
}
if (be_verbose_global)
}
<version>. {
- LexerError (_ ("quoted string expected after \\version").to_str0 ());
+ LexerError (_ ("quoted string expected after \\version").c_str ());
yy_pop_state ();
}
<sourcefilename>>. {
- LexerError (_ ("quoted string expected after \\sourcefilename").to_str0 ());
+ LexerError (_ ("quoted string expected after \\sourcefilename").c_str ());
yy_pop_state ();
}
<longcomment>{
yy_pop_state ();
}
<<EOF>> {
- LexerError (_ ("EOF found inside a comment").to_str0 ());
+ LexerError (_ ("EOF found inside a comment").c_str ());
is_main_input_ = false;
if (! close_input ())
yyterminate (); // can't move this, since it actually rets a YY_NULL
{
printf (_f ("Copyright (c) %s by\n%s and others.",
"1996--2006",
- AUTHORS).to_str0 ());
+ AUTHORS).c_str ());
printf ("\n");
}
static void
identify (FILE *out)
{
- fputs (gnu_lilypond_version_string ().to_str0 (), out);
+ fputs (gnu_lilypond_version_string ().c_str (), out);
fputs ("\n", out);
}
notice ()
{
identify (stdout);
- puts (_f (NOTICE, PROGRAM_NAME).to_str0 ());
+ puts (_f (NOTICE, PROGRAM_NAME).c_str ());
printf ("\n");
copyright ();
}
"Print usage message.")
{
/* No version number or newline here. It confuses help2man. */
- printf (_f ("Usage: %s [OPTION]... FILE...", PROGRAM_NAME).to_str0 ());
+ printf (_f ("Usage: %s [OPTION]... FILE...", PROGRAM_NAME).c_str ());
printf ("\n\n");
- printf (_ ("Typeset music and/or produce MIDI from FILE.").to_str0 ());
+ printf (_ ("Typeset music and/or produce MIDI from FILE.").c_str ());
printf ("\n\n");
- printf (_ ("LilyPond produces beautiful music notation.").to_str0 ());
+ printf (_ ("LilyPond produces beautiful music notation.").c_str ());
printf ("\n");
- printf (_f ("For more information, see %s", PROGRAM_URL).to_str0 ());
+ printf (_f ("For more information, see %s", PROGRAM_URL).c_str ());
printf ("\n\n");
- printf (_ ("Options:").to_str0 ());
+ printf (_ ("Options:").c_str ());
printf ("\n");
printf (Long_option_init::table_string (options_static).c_str ());
printf ("\n");
printf (_f ("Report bugs via %s",
"http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.bugs"
- ).to_str0 ());
+ ).c_str ());
printf ("\n");
printf ("\n");
return SCM_UNSPECIFIED;
printf ("\n");
copyright ();
printf ("\n");
- printf (_ (WARRANTY).to_str0 ());
+ printf (_ (WARRANTY).c_str ());
}
static void
prepend_load_path (String dir)
{
String s = "(set! %load-path (cons \"" + dir + "\" %load-path))";
- scm_c_eval_string (s.to_str0 ());
+ scm_c_eval_string (s.c_str ());
}
void init_global_tweak_registry ();
errno = 0;
int uid;
- if (passwd * passwd = getpwnam (components[USER_NAME].to_str0 ()))
+ if (passwd * passwd = getpwnam (components[USER_NAME].c_str ()))
uid = passwd->pw_uid;
else
{
errno = 0;
int gid;
- if (group * group = getgrnam (components[GROUP_NAME].to_str0 ()))
+ if (group * group = getgrnam (components[GROUP_NAME].c_str ()))
gid = group->gr_gid;
else
{
exit (3);
}
- if (chroot (components[JAIL].to_str0 ()))
+ if (chroot (components[JAIL].c_str ()))
{
error (_f ("can't chroot to: %s: %s", components[JAIL],
strerror (errno)));
exit (3);
}
- if (chdir (components[DIR].to_str0 ()))
+ if (chdir (components[DIR].c_str ()))
{
error (_f ("can't change working directory to: %s: %s", components[DIR],
strerror (errno)));
+ init_scheme_code_string
+ ")";
- char const *str0 = init_scheme_code_string.to_str0 ();
+ char const *str0 = init_scheme_code_string.c_str ();
if (be_verbose_global)
progress_indication (_f ("Evaluating %s", str0));
if (char const *env = getenv ("LILYPOND_LOCALEDIR"))
localedir = env;
- bindtextdomain ("lilypond", localedir.to_str0 ());
+ bindtextdomain ("lilypond", localedir.c_str ());
textdomain ("lilypond");
#endif
}