mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-30 15:00:21 +02:00
%file-port-name-canonicalization is a fluid
* libguile/fports.c (fport_canonicalize_filename): (scm_init_fports): Change %file-port-name-canonicalization to be a fluid.
This commit is contained in:
parent
0157a34157
commit
69cac23837
1 changed files with 9 additions and 7 deletions
|
@ -266,18 +266,20 @@ SCM_DEFINE (scm_file_port_p, "file-port?", 1, 0, 0,
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
|
|
||||||
static SCM* loc_file_port_name_canonicalization;
|
static SCM sys_file_port_name_canonicalization;
|
||||||
SCM_SYMBOL (sym_relative, "relative");
|
SCM_SYMBOL (sym_relative, "relative");
|
||||||
SCM_SYMBOL (sym_absolute, "absolute");
|
SCM_SYMBOL (sym_absolute, "absolute");
|
||||||
|
|
||||||
static SCM
|
static SCM
|
||||||
fport_canonicalize_filename (SCM filename)
|
fport_canonicalize_filename (SCM filename)
|
||||||
{
|
{
|
||||||
|
SCM mode = scm_fluid_ref (sys_file_port_name_canonicalization);
|
||||||
|
|
||||||
if (!scm_is_string (filename))
|
if (!scm_is_string (filename))
|
||||||
{
|
{
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
else if (scm_is_eq (*loc_file_port_name_canonicalization, sym_relative))
|
else if (scm_is_eq (mode, sym_relative))
|
||||||
{
|
{
|
||||||
char *str, *canon;
|
char *str, *canon;
|
||||||
SCM scanon, load_path;
|
SCM scanon, load_path;
|
||||||
|
@ -304,7 +306,7 @@ fport_canonicalize_filename (SCM filename)
|
||||||
SCM_UNDEFINED);
|
SCM_UNDEFINED);
|
||||||
return filename;
|
return filename;
|
||||||
}
|
}
|
||||||
else if (scm_is_eq (*loc_file_port_name_canonicalization, sym_absolute))
|
else if (scm_is_eq (mode, sym_absolute))
|
||||||
{
|
{
|
||||||
char *str, *canon;
|
char *str, *canon;
|
||||||
|
|
||||||
|
@ -950,9 +952,9 @@ scm_init_fports ()
|
||||||
scm_c_define ("_IOLBF", scm_from_int (_IOLBF));
|
scm_c_define ("_IOLBF", scm_from_int (_IOLBF));
|
||||||
scm_c_define ("_IONBF", scm_from_int (_IONBF));
|
scm_c_define ("_IONBF", scm_from_int (_IONBF));
|
||||||
|
|
||||||
loc_file_port_name_canonicalization =
|
sys_file_port_name_canonicalization = scm_make_fluid ();
|
||||||
SCM_VARIABLE_LOC (scm_c_define ("%file-port-name-canonicalization",
|
scm_c_define ("%file-port-name-canonicalization",
|
||||||
SCM_BOOL_F));
|
sys_file_port_name_canonicalization);
|
||||||
|
|
||||||
#include "libguile/fports.x"
|
#include "libguile/fports.x"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue