comparison src/toplev.cc @ 4675:f6d6335c08f6

[project @ 2003-12-16 05:11:26 by jwe]
author jwe
date Tue, 16 Dec 2003 05:11:27 +0000
parents 93ad80b6eef6
children bdc51b369a78
comparison
equal deleted inserted replaced
4674:7736835a5c8e 4675:f6d6335c08f6
667 #if defined (ENABLE_DYNAMIC_LINKING) 667 #if defined (ENABLE_DYNAMIC_LINKING)
668 bool octave_supports_dynamic_linking = true; 668 bool octave_supports_dynamic_linking = true;
669 #else 669 #else
670 bool octave_supports_dynamic_linking = false; 670 bool octave_supports_dynamic_linking = false;
671 #endif 671 #endif
672
673 // We do it this way instead of using a series of "m[KEY](0) = VAL"
674 // statements to avoid problems with gcc 2.96 (and possibly other
675 // compilers) that can't handle a long series of lines like that.
676 672
677 static bool initialized = false; 673 static bool initialized = false;
678 static Octave_map m; 674 static Octave_map m;
679 675
680 static const char * const conf_info[] = 676 static const char * const conf_info[] =
784 0, 0 780 0, 0
785 }; 781 };
786 782
787 if (! initialized) 783 if (! initialized)
788 { 784 {
789 m ["dld"](0) = octave_value (octave_supports_dynamic_linking); 785 m.assign ("dld", octave_value (octave_supports_dynamic_linking));
790 786
791 int i = 0; 787 int i = 0;
792 788
793 while (true) 789 while (true)
794 { 790 {
795 const char *key = conf_info[i++]; 791 const char *key = conf_info[i++];
796 792
797 if (key) 793 if (key)
798 m [key](0) = octave_value (conf_info[i++]); 794 m.assign (key, octave_value (conf_info[i++]));
799 else 795 else
800 break; 796 break;
801 } 797 }
802 798
803 initialized = true; 799 initialized = true;
808 if (nargin == 1) 804 if (nargin == 1)
809 { 805 {
810 std::string arg = args(0).string_value (); 806 std::string arg = args(0).string_value ();
811 807
812 if (! error_state) 808 if (! error_state)
813 retval = m [arg.c_str ()](0); 809 {
810 Cell c = m.contents (arg.c_str ());
811 retval = c(0);
812 }
814 } 813 }
815 else if (nargin == 0) 814 else if (nargin == 0)
816 retval = m; 815 retval = m;
817 else 816 else
818 print_usage ("octave_config_info"); 817 print_usage ("octave_config_info");