mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Update port mode bits documentation.
* libguile/ports.h: Update documentation of port mode bits.
This commit is contained in:
parent
9ecf77a82d
commit
a9d0fe9ea1
1 changed files with 9 additions and 10 deletions
|
@ -48,16 +48,15 @@ SCM_INTERNAL SCM scm_i_port_weak_set;
|
|||
|
||||
#define SCM_EOF_OBJECT_P(x) (scm_is_eq ((x), SCM_EOF_VAL))
|
||||
|
||||
/* PORT FLAGS
|
||||
* A set of flags characterizes a port.
|
||||
* Note that we reserve the bits 1 << 24 and above for use by the
|
||||
* routines in the port's scm_ptobfuns structure.
|
||||
*/
|
||||
#define SCM_OPN (1L<<16) /* Is the port open? */
|
||||
#define SCM_RDNG (2L<<16) /* Is it a readable port? */
|
||||
#define SCM_WRTNG (4L<<16) /* Is it writable? */
|
||||
#define SCM_BUF0 (8L<<16) /* Is it unbuffered? */
|
||||
#define SCM_BUFLINE (64L<<16) /* Is it line-buffered? */
|
||||
/* A port's first word contains its tag, which is a tc7 value. Above
|
||||
there is a flag indicating whether the port is open or not, and then
|
||||
some "mode bits": flags indicating whether the port is an input
|
||||
and/or an output port and how Guile should buffer the port. */
|
||||
#define SCM_OPN (1U<<16) /* Is the port open? */
|
||||
#define SCM_RDNG (1U<<17) /* Is it a readable port? */
|
||||
#define SCM_WRTNG (1U<<18) /* Is it writable? */
|
||||
#define SCM_BUF0 (1U<<19) /* Is it unbuffered? */
|
||||
#define SCM_BUFLINE (1U<<20) /* Is it line-buffered? */
|
||||
|
||||
#define SCM_PORTP(x) (SCM_HAS_TYP7 (x, scm_tc7_port))
|
||||
#define SCM_OPPORTP(x) (SCM_PORTP (x) && (SCM_CELL_WORD_0 (x) & SCM_OPN))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue