diff options
author | Andy Wingo <wingo@pobox.com> | 2011-12-06 19:14:50 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-12-06 19:14:50 +0100 |
commit | 04ec290f8b3e6bd6297fb10391ea7e885a55a786 (patch) | |
tree | b36dd4f7dd85dcf30c64900b9972433a54e2b4cd /libguile/ports.c | |
parent | 8806b4c28a7919b236d10751ebcb15f4a503b08c (diff) | |
parent | 679eea4f0ef7720e0ed3c9ba3fddedf35d1501d6 (diff) | |
download | guile-04ec290f8b3e6bd6297fb10391ea7e885a55a786.tar.gz |
Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
libguile/deprecation.c
libguile/load.c
libguile/print.c
Diffstat (limited to 'libguile/ports.c')
-rw-r--r-- | libguile/ports.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libguile/ports.c b/libguile/ports.c index bee2c8687..9eb6d3b9c 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -328,6 +328,17 @@ SCM_DEFINE (scm_current_error_port, "current-error-port", 0, 0, 0, } #undef FUNC_NAME +SCM +scm_current_warning_port (void) +{ + static SCM cwp_var = SCM_BOOL_F; + + if (scm_is_false (cwp_var)) + cwp_var = scm_c_private_lookup ("guile", "current-warning-port"); + + return scm_call_0 (scm_variable_ref (cwp_var)); +} + SCM_DEFINE (scm_current_load_port, "current-load-port", 0, 0, 0, (), "Return the current-load-port.\n" @@ -382,6 +393,19 @@ SCM_DEFINE (scm_set_current_error_port, "set-current-error-port", 1, 0, 0, } #undef FUNC_NAME + +SCM +scm_set_current_warning_port (SCM port) +{ + static SCM cwp_var = SCM_BOOL_F; + + if (scm_is_false (cwp_var)) + cwp_var = scm_c_private_lookup ("guile", "current-warning-port"); + + return scm_call_1 (scm_variable_ref (cwp_var), port); +} + + void scm_dynwind_current_input_port (SCM port) #define FUNC_NAME NULL |