Mercurial > octave
comparison src/variables.cc @ 1728:42b4f904f1af
[project @ 1996-01-09 11:36:01 by jwe]
author | jwe |
---|---|
date | Tue, 09 Jan 1996 11:41:43 +0000 |
parents | 63f6b1b57aae |
children | a02f140ed897 |
comparison
equal
deleted
inserted
replaced
1727:ba9b08842dbe | 1728:42b4f904f1af |
---|---|
26 #endif | 26 #endif |
27 | 27 |
28 #include <cfloat> | 28 #include <cfloat> |
29 #include <cstdio> | 29 #include <cstdio> |
30 #include <cstring> | 30 #include <cstring> |
31 | |
32 #include <string> | |
31 | 33 |
32 #include <strstream.h> | 34 #include <strstream.h> |
33 | 35 |
34 #ifdef HAVE_UNISTD_H | 36 #ifdef HAVE_UNISTD_H |
35 #include <sys/types.h> | 37 #include <sys/types.h> |
127 { | 129 { |
128 tree_fvc *ans = 0; | 130 tree_fvc *ans = 0; |
129 | 131 |
130 const char *fcn_name = 0; | 132 const char *fcn_name = 0; |
131 | 133 |
134 string tstr; | |
135 | |
132 if (arg.is_string ()) | 136 if (arg.is_string ()) |
133 fcn_name = arg.string_value (); | 137 { |
138 tstr = arg.string_value (); | |
139 fcn_name = tstr.c_str (); | |
140 } | |
134 | 141 |
135 if (! fcn_name || error_state) | 142 if (! fcn_name || error_state) |
136 { | 143 { |
137 if (warn) | 144 if (warn) |
138 error ("%s: expecting function name as argument", warn_for); | 145 error ("%s: expecting function name as argument", warn_for); |
169 { | 176 { |
170 print_usage ("is_global"); | 177 print_usage ("is_global"); |
171 return retval; | 178 return retval; |
172 } | 179 } |
173 | 180 |
174 const char *name = args(0).string_value (); | 181 string tstr = args(0).string_value (); |
182 const char *name = tstr.c_str (); | |
175 | 183 |
176 if (error_state) | 184 if (error_state) |
177 { | 185 { |
178 error ("is_global: expecting string argument"); | 186 error ("is_global: expecting string argument"); |
179 return retval; | 187 return retval; |
205 { | 213 { |
206 print_usage ("exist"); | 214 print_usage ("exist"); |
207 return retval; | 215 return retval; |
208 } | 216 } |
209 | 217 |
210 char *name = strsave (args(0).string_value ()); | 218 string tstr = args(0).string_value (); |
219 char *name = strsave (tstr.c_str ()); | |
211 | 220 |
212 if (error_state) | 221 if (error_state) |
213 { | 222 { |
214 error ("exist: expecting string argument"); | 223 error ("exist: expecting string argument"); |
215 delete [] name; | 224 delete [] name; |
926 { | 935 { |
927 tree_constant val = defn->eval (0); | 936 tree_constant val = defn->eval (0); |
928 | 937 |
929 if (! error_state && val.is_string ()) | 938 if (! error_state && val.is_string ()) |
930 { | 939 { |
931 const char *s = val.string_value (); | 940 string tstr = val.string_value (); |
941 const char *s = tstr.c_str (); | |
932 | 942 |
933 if (s) | 943 if (s) |
934 retval = strsave (s); | 944 retval = strsave (s); |
935 } | 945 } |
936 } | 946 } |