add 'orig-dir system path
svn: r2767
This commit is contained in:
parent
1d50d7b176
commit
ad18857c6e
|
@ -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_exec_cmd(char *s);
|
||||||
MZ_EXTERN Scheme_Object *scheme_set_run_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_collects_path(Scheme_Object *p);
|
||||||
|
MZ_EXTERN void scheme_set_original_dir(Scheme_Object *d);
|
||||||
|
|
||||||
/* Initialization */
|
/* Initialization */
|
||||||
MZ_EXTERN Scheme_Env *scheme_basic_env(void);
|
MZ_EXTERN Scheme_Env *scheme_basic_env(void);
|
||||||
|
|
|
@ -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 *doc_dir_symbol, *desk_dir_symbol;
|
||||||
static Scheme_Object *init_dir_symbol, *init_file_symbol, *sys_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 *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
|
#endif
|
||||||
|
|
||||||
void scheme_init_file(Scheme_Env *env)
|
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(exec_file_symbol);
|
||||||
REGISTER_SO(run_file_symbol);
|
REGISTER_SO(run_file_symbol);
|
||||||
REGISTER_SO(collects_dir_symbol);
|
REGISTER_SO(collects_dir_symbol);
|
||||||
|
REGISTER_SO(orig_dir_symbol);
|
||||||
REGISTER_SO(addon_dir_symbol);
|
REGISTER_SO(addon_dir_symbol);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -236,6 +237,7 @@ void scheme_init_file(Scheme_Env *env)
|
||||||
exec_file_symbol = scheme_intern_symbol("exec-file");
|
exec_file_symbol = scheme_intern_symbol("exec-file");
|
||||||
run_file_symbol = scheme_intern_symbol("run-file");
|
run_file_symbol = scheme_intern_symbol("run-file");
|
||||||
collects_dir_symbol = scheme_intern_symbol("collects-dir");
|
collects_dir_symbol = scheme_intern_symbol("collects-dir");
|
||||||
|
orig_dir_symbol = scheme_intern_symbol("orig-dir");
|
||||||
addon_dir_symbol = scheme_intern_symbol("addon-dir");
|
addon_dir_symbol = scheme_intern_symbol("addon-dir");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -4489,6 +4491,8 @@ find_system_path(int argc, Scheme_Object **argv)
|
||||||
collects_path = scheme_make_path("collects");
|
collects_path = scheme_make_path("collects");
|
||||||
}
|
}
|
||||||
return collects_path;
|
return collects_path;
|
||||||
|
} else if (argv[0] == orig_dir_symbol) {
|
||||||
|
return original_pwd;
|
||||||
} else if (argv[0] == addon_dir_symbol) {
|
} else if (argv[0] == addon_dir_symbol) {
|
||||||
which = id_addon_dir;
|
which = id_addon_dir;
|
||||||
} else {
|
} else {
|
||||||
|
@ -4752,6 +4756,14 @@ void scheme_set_collects_path(Scheme_Object *p)
|
||||||
collects_path = 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
|
#ifdef DOS_FILE_SYSTEM
|
||||||
|
|
|
@ -5922,6 +5922,7 @@ static void make_initial_config(Scheme_Thread *p)
|
||||||
Scheme_Object *s;
|
Scheme_Object *s;
|
||||||
s = scheme_make_path(scheme_os_getcwd(NULL, 0, NULL, 1));
|
s = scheme_make_path(scheme_os_getcwd(NULL, 0, NULL, 1));
|
||||||
init_param(cells, paramz, MZCONFIG_CURRENT_DIRECTORY, s);
|
init_param(cells, paramz, MZCONFIG_CURRENT_DIRECTORY, s);
|
||||||
|
scheme_set_original_dir(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user