]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/main.cc
release: 0.1.54
[lilypond.git] / lily / main.cc
index 4bed727ec5f7809b5b79642e53dcf969f2afb92e..dc66e42aa207b62b82741e4454290e50cf382b41 100644 (file)
@@ -6,6 +6,7 @@
   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
 */
 
+#include <stdlib.h>
 #include <iostream.h>
 #include <assert.h>
 #include "proto.hh"
@@ -23,6 +24,7 @@
 static bool version_ignore_b = false;
 Sources* source_global_l = 0;
 bool no_paper_global_b = false;
+bool no_timestamps_global_b = false;
 
 bool experimental_features_global_b = false;
 bool postscript_global_b = true;
@@ -38,14 +40,15 @@ Long_option_init theopts[] = {
   {0, "debug", 'd'},
   {1, "init", 'i'},
   {1, "include", 'I'},
-  {0, "no-midi", 'M'},
+  {0, "no-paper", 'M'},
   {0, "no-postscript", 'P'},
+  {0, "no-timestamps", 'T'},
   {0, "ignore-version", 'V'},
   {0,0,0}
 };
 
 void
-usage()
+usage ()
 {
   cout <<
     _("Usage: lilypond [options] [mudela-files]\n"
@@ -62,6 +65,7 @@ usage()
     "  -M, --no-paper         produce midi output only\n"
     "  -V, --ignore-version   ignore mudela version\n"
     "  -P, --no-postscript    don't use PostScript\n"
+    "  -T, --no-timestamps    don't timestamp the output\n"
     "\n"
     "GNU LilyPond was compiled with the following settings:\n")
 #ifdef NDEBUG
@@ -83,7 +87,7 @@ usage()
 }
 
 void
-notice()
+notice ()
 {
   cout <<
     _("\n"
@@ -132,7 +136,7 @@ do_one_file (String init_str, String file_str)
     parser.set_version_check (version_ignore_b);
     parser.parse_file (init_str, file_str);
     
-    if (file_str.length_i() && file_str[0] != '-')
+    if (file_str.length_i () && file_str[0] != '-')
       {
        String a,b,c,d;
        split_path (file_str, a, b, c, d);
@@ -146,7 +150,7 @@ do_one_file (String init_str, String file_str)
        exit_status_i_  = 1;
       }
     else
-      do_scores();
+      do_scores ();
     clear_scores ();
   }
   source_global_l = 0;
@@ -155,22 +159,24 @@ do_one_file (String init_str, String file_str)
 void
 identify ()
 {
-  cout << get_version_str() << endl;
+  cout << get_version_str () << endl;
 }
 
 int
 main (int argc, char **argv)
 {
   identify ();
-  debug_init();                // should be first
+  call_constructors ();
+  debug_init ();               // should be first
 
 
+  
+  path.add ("");
   // must override (come before) "/usr/local/share/lilypond"!
   char const *env_sz = getenv ("LILYINCLUDE");
   if (env_sz)
     path.parse_path (env_sz);
 
-  path.add ("");
   path.add (String (DIR_DATADIR) + "/init/");
 
   path.push (DIR_DATADIR);
@@ -178,7 +184,7 @@ main (int argc, char **argv)
   Getopt_long oparser (argc, argv,theopts);
   String init_str ("lily-init.ly");
 
-  while (Long_option_init const * opt = oparser())
+  while (Long_option_init const * opt = oparser ())
     {
       switch (opt->shortname)
        {
@@ -189,7 +195,7 @@ main (int argc, char **argv)
          default_outname_base_global = oparser.optional_argument_ch_C_;
          break;
        case 'w':
-         notice();
+         notice ();
          exit (0);
          break;
        case 'I':
@@ -199,7 +205,7 @@ main (int argc, char **argv)
          init_str = oparser.optional_argument_ch_C_;
          break;
        case 'h':
-         usage();
+         usage ();
          exit (0);
          break;
        case 'V':
@@ -214,6 +220,9 @@ main (int argc, char **argv)
        case 'M':
          no_paper_global_b = true;
          break;
+       case 'T':
+         no_timestamps_global_b = true;
+         break;
        default:
          assert (false);
          break;
@@ -222,7 +231,7 @@ main (int argc, char **argv)
 
   int p=0;
   const char *arg ;
-  while ((arg= oparser.get_next_arg()))
+  while ((arg= oparser.get_next_arg ()))
     {
       String f (arg);
       destill_inname (f);
@@ -241,7 +250,7 @@ main (int argc, char **argv)
 void
 destill_inname (String &name_str_r)
 {
-  if (name_str_r.length_i())
+  if (name_str_r.length_i ())
     {
       if (name_str_r[ 0 ] != '-')
        {