source file of the GNU LilyPond music typesetter
- (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include <stdlib.h>
#include "string.hh"
#include "main.hh"
#include "file-path.hh"
-#include "file-results.hh"
+#include "input-file-results.hh"
#include "warn.hh"
#include "lily-guile.hh"
#include "paper-def.hh"
follow regular localisation guidelines).
*/
static Long_option_init options_static[] = {
- /* print example usage: lilypond -e "" ? */
- {_i ("EXPR"), "evaluate", 'e',_i ("Scheme options: try -e \"(set-lily-option 'help 0)\" for more help.")},
+ {_i ("EXPR"), "evaluate", 'e',
+ _i ("set options, use -e '(ly-option-usage)' for help")},
/* another bug in option parser: --output=foe is taken as an abbreviation
for --output-format */
- {_i ("EXT"), "format", 'f', _i ("use output format EXT")},
+ {_i ("EXT"), "format", 'f', _i ("use output format EXT")},
{0, "help", 'h', _i ("this help")},
{_i ("FIELD"), "header", 'H', _i ("write header field to BASENAME.FIELD")},
{_i ("DIR"), "include", 'I', _i ("add DIR to search path")},
"lilypond").to_str0 ());
printf ("\n");
- printf (_f ("Copyright (c) %s by", "1996--2002").to_str0 ());
+ printf (_f ("Copyright (c) %s by", "1996--2003").to_str0 ());
printf ("\n");
printf (" Han-Wen Nienhuys <hanwen@cs.uu.nl>\n");
printf (" Jan Nieuwenhuizen <janneke@gnu.org>\n");
printf ("\n");
printf (_ ("GNU LilyPond -- The music typesetter").to_str0 ());
printf ("\n");
- printf (_f ("Copyright (c) %s by", "1996--2002").to_str0 ());
+ printf (_f ("Copyright (c) %s by", "1996--2003").to_str0 ());
printf ("\n");
printf (" Han-Wen Nienhuys <hanwen@cs.uu.nl>\n");
printf (" Jan Nieuwenhuizen <janneke@gnu.org>\n");
/* Where LilyPond's init files live. Typically:
LILYPOND_DATADIR = /usr/local/share/lilypond
LOCAL_LILYPOND_DATADIR = /usr/local/share/lilypond/1.5.68 */
-char const *prefix_directory[2] = {LILYPOND_DATADIR, LOCAL_LILYPOND_DATADIR};
+char const *prefix_directory[] = {LILYPOND_DATADIR, LOCAL_LILYPOND_DATADIR, 0};
void
setup_paths ()
prefix_directory[1] = lilypond_prefix;
#if HAVE_GETTEXT
- setlocale (LC_ALL, ""); /* enable locales */
- setlocale (LC_NUMERIC, "C"); /* musn't have comma's in TeX output... */
+ /* Enable locales */
+ setlocale (LC_ALL, "");
+ /* Mustn't have commas in TeX output... */
+ setlocale (LC_NUMERIC, "C");
String lily_locale_dir;
String name (PACKAGE);
name.to_lower ();
-
- /*
- urg; what *do* we want with $LILYPONDPREFIX, DIR_DATADIR and $prefix/share
- handy for multiple source-dir runs, though...
- */
- if (!String (prefix_directory[0]).empty_b ())
- {
- lily_locale_dir = String (prefix_directory[0]) + "/share/locale";
- bindtextdomain (name.to_str0 (), lily_locale_dir.to_str0 ());
- }
- else
- bindtextdomain (name.to_str0 (), LOCALEDIR);
+ bindtextdomain (name.to_str0 (), LOCALEDIR);
textdomain (name.to_str0 ());
#endif
LILYPONDPREFIX to lilypond-x.y.z */
char *suffixes[] = {"ly", "afm", "mf/out", "scm", "tfm", "ps", 0};
- for (unsigned i = 0; i < sizeof (prefix_directory)
- / sizeof (*prefix_directory); i++)
+ for (unsigned i = 0; prefix_directory[i]; i++)
for (char **s = suffixes; *s; s++)
{
String p = prefix_directory[i] + to_string ('/') + String (*s);
- global_path.add (p);
+ global_path.prepend (p);
#if !KPATHSEA
/* Urg: GNU make's $ (word) index starts at 1 */
else
{
String orig_ext = p.ext;
- char const *extensions[] = {"ly", "fly", "sly", "", 0};
+ char const *extensions[] = {"ly", "", 0};
for (int i = 0; extensions[i]; i++)
{
p.ext = orig_ext;
/* Engravers use lily.scm contents, need to make Guile find it.
Prepend onto GUILE %load-path, very ugh. */
- for (unsigned i = 0; i < sizeof (prefix_directory)
- / sizeof (*prefix_directory); i++)
+ for (unsigned i = 0; prefix_directory[i]; i++)
{
prepend_load_path (prefix_directory[i]);
+
/* Junk this. We should make real modules iso. just loading files. */
prepend_load_path (String (prefix_directory[i]) + "/scm");
}
dirinfo (stderr);
ly_init_guile ();
+ call_constructors ();
- printf ("\n");
+ progress_indication ("\n");
- call_constructors ();
all_fonts_global = new All_font_metrics (global_path.string ());
init_scheme_code_string += ")";
int p=0;
const char *arg = oparser_p_static->get_next_arg ();
-
+
+ /* Only exit until after running init_scheme_code, for
+ (ly-option-usage) or
+ -e "(ly-set-option 'help #t)" */
+ if (!arg)
+ {
+ usage ();
+ /* No FILE arguments is now a usage error */
+ exit (2);
+ }
+
do
{
String infile (arg);
String init;
if (!init_name_global.empty_b ())
init = init_name_global;
- else if (!inpath.ext.empty_b ())
- init = "init." + inpath.ext;
else
init = "init.ly";
exit (0);
}
-
- if (!oparser_p_static->current_arg () )
- {
- usage ();
- /* No FILE arguments is now a usage error */
- exit (2);
- }
-
scm_boot_guile (argc, argv, (void (*) (void*, int, char**))main_prog, 0);
return 0; // unreachable