11 #include "source-file.hh"
15 Source* source_l_g = &source;
17 bool only_midi = false;
18 extern void parse_file(String,String);
22 destill_inname( String &name_str_r);
23 Long_option_init theopts[] = {
38 "--help, -h This help\n"
39 "--warranty, -w show warranty & copyright\n"
40 "--output, -o set default output\n"
41 "--debug, -d enable debug output\n"
42 "--init, -i set init file\n"
43 "--include, -I add to file search path.\n"
44 "--midi, -M midi output only\n"
46 "LilyPond was compiled with the following settings:\n"
53 #ifdef STRING_UTILS_INLINED
54 "STRING_UTILS_INLINED "
56 "datadir= " DIR_DATADIR "\n"
67 "LilyPond, a music typesetter.\n"
68 "Copyright (C) 1996,97 by\n"
69 " Han-Wen Nienhuys <hanwen@stack.nl>\n"
70 " Jan Nieuwenhuizen <jan@digicash.com>\n"
72 " Mats Bengtsson <matsb@s3.kth.se>\n"
74 " This program is free software; you can redistribute it and/or\n"
75 "modify it under the terms of the GNU General Public License version 2\n"
76 "as published by the Free Software Foundation.\n"
78 " This program is distributed in the hope that it will be useful,\n"
79 "but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
80 "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
81 "General Public License for more details.\n"
83 " You should have received a copy (refer to the file COPYING) of the\n"
84 "GNU General Public License along with this program; if not, write to\n"
85 "the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,\n"
89 static File_path * path =0;
92 path = new File_path(String(DIR_DATADIR)+"/init/");
93 path->push(DIR_DATADIR );
102 main (int argc, char **argv)
104 Getopt_long oparser(argc, argv,theopts);
105 cout << get_version_str() << endl;
106 String init_str("symbol.ini");
108 while (Long_option_init * opt = oparser()) {
109 switch ( opt->shortname){
111 set_default_output(oparser.optarg);
118 path->push(oparser.optarg);
121 init_str = oparser.optarg;
141 while ( (arg= oparser.get_next_arg()) ) {
145 parse_file(init_str,f);
150 parse_file(init_str, "");
160 return path->find(f);
163 /// make input file name: add default extension. "" is stdin.
165 destill_inname( String &name_str_r)
167 if ( name_str_r.length_i() )
169 if( name_str_r[ 0 ] != '-' )
172 split_path(name_str_r,a,b,c,d);
174 // add extension if not present.
177 name_str_r = a+b+c+d;
179 } else name_str_r = "";