summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2016-05-14 23:25:39 +0200
committerAndy Wingo <wingo@pobox.com>2016-05-14 23:26:50 +0200
commita9d0fe9ea136563aaac3423faffe8041f0db68fe (patch)
tree5ab6993125b46fdf8223de224e6e59b682080b36
parent9ecf77a82d6060a26f6891181f4582cc19dec65e (diff)
downloadguile-a9d0fe9ea136563aaac3423faffe8041f0db68fe.tar.gz
Update port mode bits documentation.
* libguile/ports.h: Update documentation of port mode bits.
-rw-r--r--libguile/ports.h19
1 files changed, 9 insertions, 10 deletions
diff --git a/libguile/ports.h b/libguile/ports.h
index 709086c90..43cd7458d 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -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))