[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 17/21: Update port mode bits documentation.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 17/21: Update port mode bits documentation. |
Date: |
Mon, 16 May 2016 07:39:35 +0000 (UTC) |
wingo pushed a commit to branch wip-port-refactor
in repository guile.
commit a9d0fe9ea136563aaac3423faffe8041f0db68fe
Author: Andy Wingo <address@hidden>
Date: Sat May 14 23:25:39 2016 +0200
Update port mode bits documentation.
* libguile/ports.h: Update documentation of port mode bits.
---
libguile/ports.h | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/libguile/ports.h b/libguile/ports.h
index 709086c..43cd745 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))
- [Guile-commits] branch wip-port-refactor updated (d28d1a5 -> da456d2), Andy Wingo, 2016/05/16
- [Guile-commits] 07/21: Embed scm_t_port in scm_t_port_internal, Andy Wingo, 2016/05/16
- [Guile-commits] 21/21: Bump objcode version, Andy Wingo, 2016/05/16
- [Guile-commits] 02/21: Implement lookahead-u8, get-u8 in Scheme, Andy Wingo, 2016/05/16
- [Guile-commits] 10/21: Make scm_t_port private, Andy Wingo, 2016/05/16
- [Guile-commits] 17/21: Update port mode bits documentation.,
Andy Wingo <=
- [Guile-commits] 08/21: Make file/line/column fields of ports private, Andy Wingo, 2016/05/16
- [Guile-commits] 20/21: Update NEWS for release, Andy Wingo, 2016/05/16
- [Guile-commits] 18/21: Document scm_c_make_port and friends, Andy Wingo, 2016/05/16
- [Guile-commits] 01/21: %read-char speedup, Andy Wingo, 2016/05/16
- [Guile-commits] 12/21: Update port documentation, Andy Wingo, 2016/05/16
- [Guile-commits] 04/21: Add (ice-9 sports) module, Andy Wingo, 2016/05/16
- [Guile-commits] 13/21: Make scm_t_ptob_descriptor private., Andy Wingo, 2016/05/16
- [Guile-commits] 15/21: Update port type documentation, Andy Wingo, 2016/05/16
- [Guile-commits] 09/21: Make port buffering fields private, Andy Wingo, 2016/05/16
- [Guile-commits] 16/21: Add SCM_OPN to mode bits when making ports, Andy Wingo, 2016/05/16