comparison src/octave.cc @ 721:54a6858bc7e7

[project @ 1994-09-21 15:17:38 by jwe]
author jwe
date Wed, 21 Sep 1994 15:19:08 +0000
parents 36ba0576bd1b
children a2f9d3fd720c
comparison
equal deleted inserted replaced
720:43fc5a13be23 721:54a6858bc7e7
64 #include "lex.h" 64 #include "lex.h"
65 #include "help.h" 65 #include "help.h"
66 #include "octave.h" 66 #include "octave.h"
67 #include "parse.h" 67 #include "parse.h"
68 #include "defaults.h" 68 #include "defaults.h"
69 #include "user-prefs.h"
69 #include "procstream.h" 70 #include "procstream.h"
70 #include "unwind-prot.h" 71 #include "unwind-prot.h"
71 #include "octave-hist.h" 72 #include "octave-hist.h"
72 #include "builtins.h" 73 #include "builtins.h"
73 #include "version.h" 74 #include "version.h"
417 { 418 {
418 cout << "octave, version " << version_string << "\n"; 419 cout << "octave, version " << version_string << "\n";
419 exit (0); 420 exit (0);
420 } 421 }
421 422
423 static void
424 initialize_error_handlers ()
425 {
426 set_Complex_error_handler (octave_Complex_error_handler);
427
428 set_liboctave_error_handler (error);
429 }
430
422 // You guessed it. 431 // You guessed it.
423 432
424 int 433 int
425 main (int argc, char **argv) 434 main (int argc, char **argv)
426 { 435 {
427 // Allow for system dependent initialization. See sysdep.cc for more 436 // The order of these calls is important, and initialize globals must
428 // details. 437 // come before the options are processed because some command line
438 // options override defaults.
439
440 init_user_prefs ();
441
442 initialize_pager ();
443
429 sysdep_init (); 444 sysdep_init ();
430 445
431 // This is not really the right place to do this... 446 initialize_error_handlers ();
432 set_Complex_error_handler (octave_Complex_error_handler); 447
433
434 // Or this, probably...
435 set_liboctave_error_handler (error);
436
437 // Do this first, since some command line arguments may override the
438 // defaults.
439 initialize_globals (argv[0]); 448 initialize_globals (argv[0]);
440
441 // Initialize dynamic linking. This might not do anything. Must
442 // happen after initializing raw_prog_name.
443 init_dynamic_linker ();
444 449
445 int optc; 450 int optc;
446 while ((optc = getopt_long (argc, argv, short_opts, long_opts, 0)) != EOF) 451 while ((optc = getopt_long (argc, argv, short_opts, long_opts, 0)) != EOF)
447 { 452 {
448 switch (optc) 453 switch (optc)
488 // on_exit, we're going to leave some junk files around if we exit 493 // on_exit, we're going to leave some junk files around if we exit
489 // abnormally. 494 // abnormally.
490 atexit (cleanup_tmp_files); 495 atexit (cleanup_tmp_files);
491 #endif 496 #endif
492 497
493 initialize_pager (); 498 // These can come after command line args since none of them set any
499 // defaults that might be changed by command line options.
494 500
495 install_signal_handlers (); 501 install_signal_handlers ();
496 502
497 initialize_history (); 503 initialize_history ();
498 504
501 initialize_symbol_tables (); 507 initialize_symbol_tables ();
502 508
503 install_builtins (); 509 install_builtins ();
504 510
505 initialize_readline (); 511 initialize_readline ();
512
513 init_dynamic_linker ();
506 514
507 if (! inhibit_startup_message) 515 if (! inhibit_startup_message)
508 cout << "Octave, version " << version_string 516 cout << "Octave, version " << version_string
509 << ". Copyright (C) 1992, 1993, 1994 John W. Eaton.\n" 517 << ". Copyright (C) 1992, 1993, 1994 John W. Eaton.\n"
510 << "This is free software with ABSOLUTELY NO WARRANTY.\n" 518 << "This is free software with ABSOLUTELY NO WARRANTY.\n"