#include <iostream.h>
#include <assert.h>
#include <locale.h>
+#include "lily-guile.hh"
+
#include "proto.hh"
+#include "dimensions.hh"
#include "plist.hh"
#include "getopt-long.hh"
#include "misc.hh"
#include "config.hh"
#include "file-results.hh"
#include "debug.hh"
+#include "lily-guile.hh"
#if HAVE_GETTEXT
#include <libintl.h>
bool no_paper_global_b = false;
bool no_timestamps_global_b = false;
bool find_quarts_global_b = false;
+
+char const* output_global_ch = "tex";
+// temporarily default to ps, because tex is even more broken
+//char const* output_global_ch = "ps";
+
String default_outname_base_global = "lelie";
int default_count_global;
File_path global_path;
-
bool experimental_features_global_b = false;
bool dependency_global_b = false;
{0, "no-timestamps", 'T'},
{0, "find-fourths", 'Q'},
{0, "ignore-version", 'V'},
+ {1, "output-format", 'f'},
{0,0,0}
};
" -d, --dependencies write Makefile dependencies for every input file\n"
);
cout << _ (
- " -I, --include=DIR add DIR to search path\n"
+ " -h, --help this help\n"
);
cout << _ (
- " -i, --init=FILE use FILE as init file\n"
+ " -f, --output-format=X use output format X\n"
);
cout << _ (
- " -h, --help this help\n"
+ " -I, --include=DIR add DIR to search path\n"
+ );
+ cout << _ (
+ " -i, --init=FILE use FILE as init file\n"
);
cout << _ (
" -M, --no-paper produce midi output only\n"
*mlog << get_version_str () << endl;
}
-int
-main (int argc, char **argv)
+void
+setup_paths ()
{
// facilitate binary distributions
char const *env_lily = getenv ("LILYPONDPREFIX");
textdomain (name.ch_C ());
#endif
- identify ();
- call_constructors ();
- debug_init (); // should be first
-
global_path.add ("");
// must override (come before) "/usr/local/share/lilypond"!
char const *env_sz = getenv ("LILYINCLUDE");
if (!prefix_directory.empty_b())
{
- global_path.add (prefix_directory + "/share/lilypond/init/");
- global_path.add (prefix_directory + "/share/lilypond");
+ global_path.add (prefix_directory + "/share/lilypond/ly/");
+ global_path.add (prefix_directory + "/share/lilypond/afm/");
+ }
+ else
+ {
+ global_path.add (String (DIR_DATADIR) + "/ly/");
+ global_path.add (String (DIR_DATADIR) + "/afm/");
}
+}
- global_path.add (String (DIR_DATADIR) + "/init/");
- global_path.push (DIR_DATADIR);
- Getopt_long oparser (argc, argv,theopts);
- String init_str;
+void
+main_prog (int argc, char **argv)
+{
+ identify ();
+ call_constructors ();
+ debug_init (); // should be first
+ setup_paths ();
+
+ String init_str;
String outname_str;
+
+ Getopt_long oparser (argc, argv,theopts);
while (Long_option_init const * opt = oparser ())
{
switch (opt->shortname)
{
case 't':
experimental_features_global_b = true;
+ *mlog << "*** enabling experimental features, you're on your own now ***\n";
break;
case 'o':
outname_str = oparser.optional_argument_ch_C_;
notice ();
exit (0);
break;
+ case 'f':
+ output_global_ch = oparser.optional_argument_ch_C_;
+ break;
case 'Q':
find_quarts_global_b = true;
break;
default_outname_base_global = outname_str;
do_one_file (i, default_outname_base_global);
}
+ exit( exit_status_i_);
+}
+int
+main (int argc, char **argv)
+{
+#ifdef HAVE_LIBGUILE
+ gh_enter (argc, argv, (void(*)())main_prog);
+ return exit_status_i_;
+#else
+ main_prog (argc, argv);
return exit_status_i_;
+#endif
}
-/*
- urg: make input file name:
+/**
+ make input file name from command arg.
- input: file name
+ @input file name
- output: file name with added default extension. "" is stdin.
+ @output file name with added default extension. "" is stdin.
in reference argument: the extension. ".ly" if none
*/
String
split_path (str,a,b,c,ext_r);
// add extension if not present.
+ // UGH. Should parametrise in list of default extensions.
if (ext_r.empty_b ())
{
ext_r = ".fly";