add 'orig-dir system path

svn: r2767
This commit is contained in:
Matthew Flatt 2006-04-24 19:20:44 +00:00
parent 1d50d7b176
commit ad18857c6e
3 changed files with 16 additions and 2 deletions

View File

@ -1565,6 +1565,7 @@ MZ_EXTERN void scheme_set_banner(char *s);
MZ_EXTERN Scheme_Object *scheme_set_exec_cmd(char *s);
MZ_EXTERN Scheme_Object *scheme_set_run_cmd(char *s);
MZ_EXTERN void scheme_set_collects_path(Scheme_Object *p);
MZ_EXTERN void scheme_set_original_dir(Scheme_Object *d);
/* Initialization */
MZ_EXTERN Scheme_Env *scheme_basic_env(void);

View File

@ -185,9 +185,9 @@ static Scheme_Object *temp_dir_symbol, *home_dir_symbol, *pref_dir_symbol;
static Scheme_Object *doc_dir_symbol, *desk_dir_symbol;
static Scheme_Object *init_dir_symbol, *init_file_symbol, *sys_dir_symbol;
static Scheme_Object *exec_file_symbol, *run_file_symbol, *collects_dir_symbol;
static Scheme_Object *pref_file_symbol, *addon_dir_symbol;
static Scheme_Object *pref_file_symbol, *orig_dir_symbol, *addon_dir_symbol;
static Scheme_Object *exec_cmd, *run_cmd, *collects_path;
static Scheme_Object *exec_cmd, *run_cmd, *collects_path, *original_pwd;
#endif
void scheme_init_file(Scheme_Env *env)
@ -212,6 +212,7 @@ void scheme_init_file(Scheme_Env *env)
REGISTER_SO(exec_file_symbol);
REGISTER_SO(run_file_symbol);
REGISTER_SO(collects_dir_symbol);
REGISTER_SO(orig_dir_symbol);
REGISTER_SO(addon_dir_symbol);
#endif
@ -236,6 +237,7 @@ void scheme_init_file(Scheme_Env *env)
exec_file_symbol = scheme_intern_symbol("exec-file");
run_file_symbol = scheme_intern_symbol("run-file");
collects_dir_symbol = scheme_intern_symbol("collects-dir");
orig_dir_symbol = scheme_intern_symbol("orig-dir");
addon_dir_symbol = scheme_intern_symbol("addon-dir");
#endif
@ -4489,6 +4491,8 @@ find_system_path(int argc, Scheme_Object **argv)
collects_path = scheme_make_path("collects");
}
return collects_path;
} else if (argv[0] == orig_dir_symbol) {
return original_pwd;
} else if (argv[0] == addon_dir_symbol) {
which = id_addon_dir;
} else {
@ -4752,6 +4756,14 @@ void scheme_set_collects_path(Scheme_Object *p)
collects_path = p;
}
void scheme_set_original_dir(Scheme_Object *d)
{
if (!original_pwd) {
REGISTER_SO(original_pwd);
}
original_pwd = d;
}
/********************************************************************************/
#ifdef DOS_FILE_SYSTEM

View File

@ -5922,6 +5922,7 @@ static void make_initial_config(Scheme_Thread *p)
Scheme_Object *s;
s = scheme_make_path(scheme_os_getcwd(NULL, 0, NULL, 1));
init_param(cells, paramz, MZCONFIG_CURRENT_DIRECTORY, s);
scheme_set_original_dir(s);
}
{