comparison src/variables.cc @ 1504:c29439c3f3fa

[project @ 1995-10-03 02:57:35 by jwe]
author jwe
date Tue, 03 Oct 1995 03:00:29 +0000
parents 75e9ce7a1ce2
children 7b665f9a97fa
comparison
equal deleted inserted replaced
1503:a49a80c912db 1504:c29439c3f3fa
888 888
889 return retval; 889 return retval;
890 } 890 }
891 891
892 // Look for the given name in the global symbol table. If it refers 892 // Look for the given name in the global symbol table. If it refers
893 // to a real scalar, place the value in d and return 0. Otherwise, 893 // to a real scalar, place the value in d and return 1. Otherwise,
894 // return -1. 894 // return 0.
895 895
896 int 896 int
897 builtin_real_scalar_variable (const char *name, double& d) 897 builtin_real_scalar_variable (const char *name, double& d)
898 { 898 {
899 int status = -1; 899 int status = 0;
900 symbol_record *sr = global_sym_tab->lookup (name, 0, 0); 900 symbol_record *sr = global_sym_tab->lookup (name, 0, 0);
901 901
902 // It is a prorgramming error to look for builtins that aren't. 902 // It is a prorgramming error to look for builtins that aren't.
903 903
904 assert (sr); 904 assert (sr);
910 tree_constant val = defn->eval (0); 910 tree_constant val = defn->eval (0);
911 911
912 if (! error_state && val.is_scalar_type ()) 912 if (! error_state && val.is_scalar_type ())
913 { 913 {
914 d = val.double_value (); 914 d = val.double_value ();
915 status = 0; 915 status = 1;
916 } 916 }
917 } 917 }
918 918
919 return status; 919 return status;
920 } 920 }
1671 DEFVAR ("gnuplot_binary", SBV_gnuplot_binary, "gnuplot", 0, 1671 DEFVAR ("gnuplot_binary", SBV_gnuplot_binary, "gnuplot", 0,
1672 sv_gnuplot_binary, 1672 sv_gnuplot_binary,
1673 "path to gnuplot binary"); 1673 "path to gnuplot binary");
1674 1674
1675 #ifdef GNUPLOT_HAS_MULTIPLOT 1675 #ifdef GNUPLOT_HAS_MULTIPLOT
1676 double gnuplot_has_multiplot = "true"; 1676 char *with_multiplot = "true";
1677 #else 1677 #else
1678 double gnuplot_has_multiplot = "false"; 1678 char *with_multiplot = "false";
1679 #endif 1679 #endif
1680 1680
1681 DEFVAR ("gnuplot_has_multiplot", SBV_gnuplot_has_multiplot, 1681 DEFVAR ("gnuplot_has_multiplot", SBV_gnuplot_has_multiplot,
1682 gnuplot_has_multiplot, 0, gnuplot_has_multiplot, 1682 with_multiplot, 0, gnuplot_has_multiplot,
1683 "true if gnuplot supports multiplot, false otherwise"); 1683 "true if gnuplot supports multiplot, false otherwise");
1684 1684
1685 DEFCONST ("i", SBV_i, Complex (0.0, 1.0), 1, 0, 1685 DEFCONST ("i", SBV_i, Complex (0.0, 1.0), 1, 0,
1686 "sqrt (-1)"); 1686 "sqrt (-1)");
1687 1687