]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/main.cc
release: 1.0.17
[lilypond.git] / lily / main.cc
index 74543baf2cc819e3f34afd6f0e6e59f628b9aa72..5b541eb29fb8bed2e5015d7dc45ebb622fdf9a69 100644 (file)
@@ -10,8 +10,6 @@
 #include <iostream.h>
 #include <assert.h>
 #include <locale.h>
-#include "lily-guile.hh"
-
 #include "proto.hh"
 #include "dimensions.hh"
 #include "plist.hh"
@@ -188,8 +186,17 @@ identify ()
   *mlog << get_version_str () << endl;
 }
 
+void 
+guile_init ()
+{
+#ifdef   HAVE_LIBGUILE
+   gh_eval_str ("(define (add-column p) (display \"adding column (in guile): \") (display p) (newline))");
+#endif
+}
+
+
 void
-main_prog (int argc, char **argv)
+setup_paths ()
 {
   // facilitate binary distributions
   char const *env_lily = getenv ("LILYPONDPREFIX");
@@ -213,10 +220,6 @@ main_prog (int argc, char **argv)
   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");
@@ -231,11 +234,24 @@ main_prog (int argc, char **argv)
 
   global_path.add (String (DIR_DATADIR) + "/ly/");
   global_path.add (String (DIR_DATADIR) + "/afm/");  
+}
 
-  Getopt_long oparser (argc, argv,theopts);
-  String init_str;
 
+
+int
+main_prog (int argc, char **argv)
+{
+  guile_init ();
+  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)
@@ -243,7 +259,6 @@ main_prog (int argc, char **argv)
        case 't':
          experimental_features_global_b = true;
          global_lookup_l = &ps_lookup;
-         *mlog << "*** enabling experimental features, you're on your own now ***\n";
          break;
        case 'o':
          outname_str = oparser.optional_argument_ch_C_;
@@ -329,18 +344,8 @@ main_prog (int argc, char **argv)
        default_outname_base_global = outname_str;
       do_one_file (i, default_outname_base_global);
     }
-}
 
-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
 }
 
 /*
@@ -380,3 +385,19 @@ distill_inname_str (String name_str, String& ext_r)
   return str;
 }
 
+
+#ifdef HAVE_LIBGUILE
+int
+main (int argc, char **argv)
+{
+  gh_enter (argc, argv, (void(*)())main_prog);
+  return exit_status_i_;
+}
+
+#else
+int main (int argc, char **argv)
+{
+  return main_prog (argc, argv);
+}
+
+#endif