comparison src/octave.cc @ 5794:1138ced03f14

[project @ 2006-05-08 20:23:04 by jwe]
author jwe
date Mon, 08 May 2006 20:23:07 +0000
parents faafc2d98b8d
children 67bf9b4f2ae2
comparison
equal deleted inserted replaced
5793:395382df0d8a 5794:1138ced03f14
476 static void 476 static void
477 maximum_braindamage (void) 477 maximum_braindamage (void)
478 { 478 {
479 persist = true; 479 persist = true;
480 480
481 bind_builtin_variable ("PS1", ">> "); 481 bind_internal_variable ("PS1", ">> ");
482 bind_builtin_variable ("PS2", ""); 482 bind_internal_variable ("PS2", "");
483 bind_builtin_variable ("beep_on_error", true); 483 bind_internal_variable ("beep_on_error", true);
484 bind_builtin_variable ("crash_dumps_octave_core", false); 484 bind_internal_variable ("crash_dumps_octave_core", false);
485 bind_builtin_variable ("default_save_options", "-mat-binary"); 485 bind_internal_variable ("default_save_options", "-mat-binary");
486 bind_builtin_variable ("fixed_point_format", true); 486 bind_internal_variable ("fixed_point_format", true);
487 bind_builtin_variable ("history_timestamp_format_string", 487 bind_internal_variable ("history_timestamp_format_string",
488 "%%-- %D %I:%M %p --%%"); 488 "%%-- %D %I:%M %p --%%");
489 bind_builtin_variable ("page_screen_output", false); 489 bind_internal_variable ("page_screen_output", false);
490 bind_builtin_variable ("print_empty_dimensions", false); 490 bind_internal_variable ("print_empty_dimensions", false);
491 bind_builtin_variable ("warn_function_name_clash", false); 491 bind_internal_variable ("warn_function_name_clash", false);
492 } 492 }
493 493
494 // You guessed it. 494 // You guessed it.
495 495
496 int 496 int
504 // The order of these calls is important. The call to 504 // The order of these calls is important. The call to
505 // install_defaults must come before install_builtins because 505 // install_defaults must come before install_builtins because
506 // default variable values must be available for the variables to be 506 // default variable values must be available for the variables to be
507 // installed, and the call to install_builtins must come before the 507 // installed, and the call to install_builtins must come before the
508 // options are processed because some command line options override 508 // options are processed because some command line options override
509 // defaults by calling bind_builtin_variable. 509 // defaults by calling bind_internal_variable.
510 510
511 sysdep_init (); 511 sysdep_init ();
512 512
513 // The idea here is to force xerbla to be referenced so that we will 513 // The idea here is to force xerbla to be referenced so that we will
514 // link to our own version instead of the one provided by the BLAS 514 // link to our own version instead of the one provided by the BLAS
517 517
518 if (octave_NaN == -1) 518 if (octave_NaN == -1)
519 F77_FUNC (xerbla, XERBLA) ("octave", 13, 6L); 519 F77_FUNC (xerbla, XERBLA) ("octave", 13, 6L);
520 520
521 initialize_error_handlers (); 521 initialize_error_handlers ();
522
523 initialize_default_warning_state ();
522 524
523 install_defaults (); 525 install_defaults ();
524 526
525 initialize_pathsearch (); 527 initialize_pathsearch ();
526 528
543 while ((optc = args.getopt ()) != EOF) 545 while ((optc = args.getopt ()) != EOF)
544 { 546 {
545 switch (optc) 547 switch (optc)
546 { 548 {
547 case 'H': 549 case 'H':
548 bind_builtin_variable ("saving_history", false); 550 bind_internal_variable ("saving_history", false);
549 break; 551 break;
550 552
551 case 'V': 553 case 'V':
552 verbose_flag = true; 554 verbose_flag = true;
553 break; 555 break;
571 forced_interactive = true; 573 forced_interactive = true;
572 break; 574 break;
573 575
574 case 'p': 576 case 'p':
575 if (args.optarg ()) 577 if (args.optarg ())
576 bind_builtin_variable ("LOADPATH", args.optarg ()); 578 bind_internal_variable ("LOADPATH", args.optarg ());
577 break; 579 break;
578 580
579 case 'q': 581 case 'q':
580 inhibit_startup_message = true; 582 inhibit_startup_message = true;
581 break; 583 break;
582 584
583 case 'x': 585 case 'x':
584 { 586 {
585 double tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE); 587 double tmp = (ECHO_SCRIPTS | ECHO_FUNCTIONS | ECHO_CMD_LINE);
586 bind_builtin_variable ("echo_executing_commands", tmp); 588 bind_internal_variable ("echo_executing_commands", tmp);
587 } 589 }
588 break; 590 break;
589 591
590 case 'v': 592 case 'v':
591 print_version_and_exit (); 593 print_version_and_exit ();
601 } 603 }
602 break; 604 break;
603 605
604 case EXEC_PATH_OPTION: 606 case EXEC_PATH_OPTION:
605 if (args.optarg ()) 607 if (args.optarg ())
606 bind_builtin_variable ("EXEC_PATH", args.optarg ()); 608 bind_internal_variable ("exec_path", args.optarg ());
607 break; 609 break;
608 610
609 case INFO_FILE_OPTION: 611 case INFO_FILE_OPTION:
610 if (args.optarg ()) 612 if (args.optarg ())
611 bind_builtin_variable ("INFO_FILE", args.optarg ()); 613 bind_internal_variable ("info_file", args.optarg ());
612 break; 614 break;
613 615
614 case INFO_PROG_OPTION: 616 case INFO_PROG_OPTION:
615 if (args.optarg ()) 617 if (args.optarg ())
616 bind_builtin_variable ("INFO_PROGRAM", args.optarg ()); 618 bind_internal_variable ("info_program", args.optarg ());
617 break; 619 break;
618 620
619 case NO_INIT_FILE_OPTION: 621 case NO_INIT_FILE_OPTION:
620 read_init_files = false; 622 read_init_files = false;
621 break; 623 break;
667 669
668 execute_default_pkg_add_files (); 670 execute_default_pkg_add_files ();
669 671
670 execute_startup_files (); 672 execute_startup_files ();
671 673
672 command_history::read (false); 674 initialize_history ();
673 675
674 if (! inhibit_startup_message && reading_startup_message_printed) 676 if (! inhibit_startup_message && reading_startup_message_printed)
675 std::cout << std::endl; 677 std::cout << std::endl;
676 678
677 // Is input coming from a terminal? If so, we are probably 679 // Is input coming from a terminal? If so, we are probably
733 { 735 {
734 command_editor::blink_matching_paren (false); 736 command_editor::blink_matching_paren (false);
735 737
736 // FIXME -- is this the right thing to do? 738 // FIXME -- is this the right thing to do?
737 739
738 bind_builtin_variable ("echo_executing_commands", ECHO_CMD_LINE); 740 bind_internal_variable ("echo_executing_commands", ECHO_CMD_LINE);
739 } 741 }
740 742
741 if (embedded) 743 if (embedded)
742 { 744 {
743 // FIXME -- do we need to do any cleanup here before 745 // FIXME -- do we need to do any cleanup here before