1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-30 06:50:31 +02:00

* ports.c, ports.h (close-input-port, close-output-port): New R5RS

procedures.
This commit is contained in:
Mikael Djurfeldt 2000-04-15 19:29:47 +00:00
parent 01c8a3dd96
commit 7a754ca6c2

View file

@ -1,4 +1,4 @@
/* Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
/* Copyright (C) 1995,1996,1997,1998,1999, 2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -635,6 +635,37 @@ SCM_DEFINE (scm_close_port, "close-port", 1, 0, 0,
}
#undef FUNC_NAME
SCM_DEFINE (scm_close_input_port, "close-input-port", 1, 0, 0,
(SCM port),
"Close the specified input port object. The routine has no effect if\n"
"the file has already been closed. An exception may be raised if an\n"
"error occurs. The value returned is unspecified.\n\n"
"See also @ref{Ports and File Descriptors, close}, for a procedure\n"
"which can close file descriptors.")
#define FUNC_NAME s_scm_close_input_port
{
SCM_VALIDATE_INPUT_PORT (1, port);
scm_close_port (port);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
SCM_DEFINE (scm_close_output_port, "close-output-port", 1, 0, 0,
(SCM port),
"Close the specified output port object. The routine has no effect if\n"
"the file has already been closed. An exception may be raised if an\n"
"error occurs. The value returned is unspecified.\n\n"
"See also @ref{Ports and File Descriptors, close}, for a procedure\n"
"which can close file descriptors.")
#define FUNC_NAME s_scm_close_output_port
{
port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OUTPUT_PORT (1, port);
scm_close_port (port);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
SCM_DEFINE (scm_close_all_ports_except, "close-all-ports-except", 0, 0, 1,
(SCM ports),
"Close all open file ports used by the interpreter\n"