char const * longname;
char shortname;
- ostream &printon(ostream &errorout);
+ void printon(ostream &errorout)const ;
};
argument reordering
*/
class Getopt_long {
-public:
- /** errorcodes: no error, argument expected, no argument expected,
- unknown option, illegal argument (eg. int expected). */
- enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
- E_ILLEGALARG } ;
-
-
-private:
/// the option info.
- Long_option_init *the_opts;
- int table_len;
+ const Long_option_init *option_a_;
+ int table_len_i_;
- /// if doing short option, argv[optind][optindind] is processed next.
- int optindind;
+ /// if doing short option, arg_value_ch_a_a_[optind][optindind] is processed next.
+ int argument_index_i_;
/// the option found
- Long_option_init *beet;
+ const Long_option_init *found_option_l_;
- /// get ready for processing next error.
- bool next();
- Long_option_init *parselong();
- Long_option_init *parseshort();
-
- ostream *errorout;
- /// report an error and abort
- void report(Errorcod c);
-public:
+public:
+ /** errorcodes: no error, argument expected, no argument expected,
+ unknown option, illegal argument (eg. int expected). */
+ enum Errorcod { E_NOERROR = 0, E_ARGEXPECT, E_NOARGEXPECT, E_UNKNOWNOPTION,
+ E_ILLEGALARG } ;
/// argument. Set to 0 if not present
- char* optarg;
+ char const * optional_argument_ch_C_;
/// current error status
- Errorcod error;
+ Errorcod error_;
- /// return an integer (with err. detect)
- long intarg();
- /// argv[optind] will be processed next.
- int optind;
+ /// arg_value_ch_a_a_[array_index_i_] will be processed next.
+ int array_index_i_;
/// the arguments
- char **argv;
+ char **arg_value_ch_a_a_;
/// the arg. count
- int argc;
-
- /* *************** */
+ int argument_count_i_;
+
+ ostream *error_ostream_l_;
+
+public:
+ /// get ready for processing next error.
+ void next();
+ const Long_option_init *parselong();
+ const Long_option_init *parseshort();
+ void OK()const;
+ bool ok() const;
+
+ /// report an error and abort
+ void report(Errorcod c);
+
+
+ /// return an integer (with err. detect)
+ long argument_to_i();
+
/**
What to do with errors.
@return pointer to next option found.
0 if error occurred, or next argument is no option.
*/
- Long_option_init *operator()();
+ const Long_option_init *operator()();
- char *current_arg();
- char * get_next_arg();
+ char const *current_arg();
+ char const * get_next_arg();
};
#endif
Sources* source_l_g = 0;
bool only_midi = false;
bool version_ignore_b_ = false;
+int exit_status_i_;
void destill_inname( String &name_str_r);
#ifdef STRING_UTILS_INLINED
"STRING_UTILS_INLINED "
#endif
- "datadir= " DIR_DATADIR "\n"
+ "datadir= " DIR_DATADIR
+
+ "\n";
+
;
{
cout <<
"\n"
- "GNU LilyPond, a music typesetter.\n"
- "Copyright (C) 1996,97 by\n"
+ "GNU LilyPond -- The GNU Project music typesetter.\n"
+ "Copyright 1996,97 by\n"
" Han-Wen Nienhuys <hanwen@stack.nl>\n"
" Jan Nieuwenhuizen <jan@digicash.com>\n"
- "Contributors\n"
- " Mats Bengtsson <matsb@s3.kth.se>\n"
- " Werner Lemberg <xlwy01@uxp1.hrz.uni-dortmund.de>\n"
"\n"
" This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License version 2\n"
do_one_file(String init_str, String file_str)
{
if ( init_str != "" && "" == path.find( init_str ) ) {
- error ( "Can not find `" + init_str +"'");
+ error ( "Can not find `" + init_str +"\'");
return ;
}
if ( file_str!= "" && path.find( file_str ) == "" ) {
cout << get_version_str() << endl;
String init_str("symbol.ly");
- while (Long_option_init * opt = oparser()) {
+ while (Long_option_init const * opt = oparser()) {
switch ( opt->shortname){
case 'o':
- set_default_output(oparser.optarg);
+ set_default_output(oparser.optional_argument_ch_C_);
break;
case 'w':
notice();
exit(0);
break;
case 'I':
- path.push(oparser.optarg);
+ path.push(oparser.optional_argument_ch_C_);
break;
case 'i':
- init_str = oparser.optarg;
+ init_str = oparser.optional_argument_ch_C_;
break;
case 'h':
usage();
}
int p=0;
- char *arg ;
+ const char *arg ;
while ( (arg= oparser.get_next_arg()) ) {
String f(arg);
destill_inname(f);
do_one_file(init_str, "");
}
- return 0;
+ return exit_status_i_;
}
/// make input file name: add default extension. "" is stdin.