comparison src/utils.cc @ 422:875977d1f8cf

[project @ 1994-05-23 20:50:51 by jwe]
author jwe
date Mon, 23 May 1994 20:50:51 +0000
parents 9b12e22758d5
children 90964309100b
comparison
equal deleted inserted replaced
421:92f07c38e821 422:875977d1f8cf
437 } 437 }
438 438
439 char * 439 char *
440 octave_home (void) 440 octave_home (void)
441 { 441 {
442 #ifdef RUN_IN_PLACE
443 static char *home = OCTAVE_HOME;
444 return home;
445 #else
442 static char *home = (char *) NULL; 446 static char *home = (char *) NULL;
443 delete [] home; 447 delete [] home;
444 char *oh = getenv ("OCTAVE_HOME"); 448 char *oh = getenv ("OCTAVE_HOME");
445 if (oh != (char *) NULL) 449 if (oh != (char *) NULL)
446 home = strsave (oh); 450 home = strsave (oh);
447 else 451 else
448 home = strsave (OCTAVE_HOME); 452 home = strsave (OCTAVE_HOME);
449 return home; 453 return home;
454 #endif
450 } 455 }
451 456
452 char * 457 char *
453 octave_lib_dir (void) 458 octave_lib_dir (void)
454 { 459 {
460 #ifdef RUN_IN_PLACE
461 static char *ol = OCTAVE_LIB_DIR;
462 return ol;
463 #else
455 static char *ol = (char *) NULL; 464 static char *ol = (char *) NULL;
456 delete [] ol; 465 delete [] ol;
457 char *oh = octave_home (); 466 char *oh = octave_home ();
458 char *tmp = strconcat (oh, "/lib/octave/"); 467 char *tmp = strconcat (oh, "/lib/octave/");
459 ol = strconcat (tmp, version_string); 468 ol = strconcat (tmp, version_string);
460 delete [] tmp; 469 delete [] tmp;
461 return ol; 470 return ol;
471 #endif
462 } 472 }
463 473
464 char * 474 char *
465 octave_info_dir (void) 475 octave_info_dir (void)
466 { 476 {
477 #ifdef RUN_IN_PLACE
478 static char *oi = OCTAVE_INFO_DIR;
479 return oi;
480 #else
467 static char *oi = (char *) NULL; 481 static char *oi = (char *) NULL;
468 delete [] oi; 482 delete [] oi;
469 char *oh = octave_home (); 483 char *oh = octave_home ();
470 oi = strconcat (oh, "/info/"); 484 oi = strconcat (oh, "/info/");
471 return oi; 485 return oi;
486 #endif
472 } 487 }
473 488
474 /* 489 /*
475 * Handle OCTAVE_PATH from the environment like TeX handles TEXINPUTS. 490 * Handle OCTAVE_PATH from the environment like TeX handles TEXINPUTS.
476 * If the path starts with `:', prepend the standard path. If it ends 491 * If the path starts with `:', prepend the standard path. If it ends