comparison src/defaults.cc @ 8008:4d13a7a2f6ab

dir_path: use singleton class for static data members
author John W. Eaton <jwe@octave.org>
date Tue, 05 Aug 2008 12:04:10 -0400
parents a2ab20ba78f7
children eace5649a8b5
comparison
equal deleted inserted replaced
8007:a2ab20ba78f7 8008:4d13a7a2f6ab
231 } 231 }
232 232
233 void 233 void
234 set_exec_path (const std::string& path) 234 set_exec_path (const std::string& path)
235 { 235 {
236 VEXEC_PATH = Vlocal_ver_arch_lib_dir + dir_path::path_sep_str 236 VEXEC_PATH = Vlocal_ver_arch_lib_dir + dir_path::path_sep_str ()
237 + Vlocal_api_arch_lib_dir + dir_path::path_sep_str 237 + Vlocal_api_arch_lib_dir + dir_path::path_sep_str ()
238 + Vlocal_arch_lib_dir + dir_path::path_sep_str 238 + Vlocal_arch_lib_dir + dir_path::path_sep_str ()
239 + Varch_lib_dir + dir_path::path_sep_str 239 + Varch_lib_dir + dir_path::path_sep_str ()
240 + Vbin_dir; 240 + Vbin_dir;
241 241
242 // This is static so that even if set_exec_path is called more than 242 // This is static so that even if set_exec_path is called more than
243 // once, shell_path is the original PATH from the environment, 243 // once, shell_path is the original PATH from the environment,
244 // before we start modifying it. 244 // before we start modifying it.
245 static std::string shell_path = octave_env::getenv ("PATH"); 245 static std::string shell_path = octave_env::getenv ("PATH");
246 246
247 if (! shell_path.empty ()) 247 if (! shell_path.empty ())
248 VEXEC_PATH += dir_path::path_sep_str + shell_path; 248 VEXEC_PATH += dir_path::path_sep_str () + shell_path;
249 249
250 std::string tpath = path; 250 std::string tpath = path;
251 251
252 if (tpath.empty ()) 252 if (tpath.empty ())
253 tpath = octave_env::getenv ("OCTAVE_EXEC_PATH"); 253 tpath = octave_env::getenv ("OCTAVE_EXEC_PATH");
254 254
255 if (! tpath.empty ()) 255 if (! tpath.empty ())
256 VEXEC_PATH = tpath + dir_path::path_sep_str + VEXEC_PATH; 256 VEXEC_PATH = tpath + dir_path::path_sep_str () + VEXEC_PATH;
257 257
258 octave_env::putenv ("PATH", VEXEC_PATH); 258 octave_env::putenv ("PATH", VEXEC_PATH);
259 } 259 }
260 260
261 void 261 void
267 267
268 if (tpath.empty ()) 268 if (tpath.empty ())
269 tpath = octave_env::getenv ("OCTAVE_IMAGE_PATH"); 269 tpath = octave_env::getenv ("OCTAVE_IMAGE_PATH");
270 270
271 if (! tpath.empty ()) 271 if (! tpath.empty ())
272 VIMAGE_PATH += dir_path::path_sep_str + tpath; 272 VIMAGE_PATH += dir_path::path_sep_str () + tpath;
273 273
274 tpath = genpath (Vimage_dir, ""); 274 tpath = genpath (Vimage_dir, "");
275 275
276 if (! tpath.empty ()) 276 if (! tpath.empty ())
277 VIMAGE_PATH += dir_path::path_sep_str + tpath; 277 VIMAGE_PATH += dir_path::path_sep_str () + tpath;
278 } 278 }
279 279
280 static void 280 static void
281 set_default_info_file (void) 281 set_default_info_file (void)
282 { 282 {