[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 13/21: Make scm_t_ptob_descriptor private.
From: |
Andy Wingo |
Subject: |
[Guile-commits] 13/21: Make scm_t_ptob_descriptor private. |
Date: |
Mon, 16 May 2016 07:39:34 +0000 (UTC) |
wingo pushed a commit to branch wip-port-refactor
in repository guile.
commit 17f90360b6057034135ec93ffae340fa514208af
Author: Andy Wingo <address@hidden>
Date: Fri May 13 17:14:59 2016 +0200
Make scm_t_ptob_descriptor private.
* libguile/goops.c: Use port internals header.
* libguile/ports-internal.h (scm_t_port_type_flags)
(struct scm_t_ptob_descriptor): Make private.
* libguile/ports.h: Adapt.
---
libguile/goops.c | 1 +
libguile/ports-internal.h | 31 +++++++++++++++++++++++++++++++
libguile/ports.h | 31 +------------------------------
3 files changed, 33 insertions(+), 30 deletions(-)
diff --git a/libguile/goops.c b/libguile/goops.c
index 1f7ec90..cb9b6a6 100644
--- a/libguile/goops.c
+++ b/libguile/goops.c
@@ -40,6 +40,7 @@
#include "libguile/macros.h"
#include "libguile/modules.h"
#include "libguile/ports.h"
+#include "libguile/ports-internal.h"
#include "libguile/procprop.h"
#include "libguile/programs.h"
#include "libguile/smob.h"
diff --git a/libguile/ports-internal.h b/libguile/ports-internal.h
index e56d40b..394eaf8 100644
--- a/libguile/ports-internal.h
+++ b/libguile/ports-internal.h
@@ -27,6 +27,37 @@
#include "libguile/_scm.h"
#include "libguile/ports.h"
+typedef enum scm_t_port_type_flags {
+ /* Indicates that the port should be closed if it is garbage collected
+ while it is open. */
+ SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC = 1 << 0
+} scm_t_port_type_flags;
+
+/* port-type description. */
+struct scm_t_ptob_descriptor
+{
+ char *name;
+ int (*print) (SCM exp, SCM port, scm_print_state *pstate);
+
+ size_t (*c_read) (SCM port, SCM dst, size_t start, size_t count);
+ size_t (*c_write) (SCM port, SCM src, size_t start, size_t count);
+ SCM scm_read;
+ SCM scm_write;
+
+ scm_t_off (*seek) (SCM port, scm_t_off OFFSET, int WHENCE);
+ void (*close) (SCM port);
+
+ void (*get_natural_buffer_sizes) (SCM port, size_t *read_size,
+ size_t *write_size);
+ int (*random_access_p) (SCM port);
+
+ int (*input_waiting) (SCM port);
+
+ void (*truncate) (SCM port, scm_t_off length);
+
+ unsigned flags;
+};
+
/* Port buffers.
It's important to avoid calling into the kernel too many times. For
diff --git a/libguile/ports.h b/libguile/ports.h
index f90a6b6..18de70f 100644
--- a/libguile/ports.h
+++ b/libguile/ports.h
@@ -78,36 +78,7 @@ SCM_INTERNAL SCM scm_i_port_weak_set;
-typedef enum scm_t_port_type_flags {
- /* Indicates that the port should be closed if it is garbage collected
- while it is open. */
- SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC = 1 << 0
-} scm_t_port_type_flags;
-
-/* port-type description. */
-typedef struct scm_t_ptob_descriptor
-{
- char *name;
- int (*print) (SCM exp, SCM port, scm_print_state *pstate);
-
- size_t (*c_read) (SCM port, SCM dst, size_t start, size_t count);
- size_t (*c_write) (SCM port, SCM src, size_t start, size_t count);
- SCM scm_read;
- SCM scm_write;
-
- scm_t_off (*seek) (SCM port, scm_t_off OFFSET, int WHENCE);
- void (*close) (SCM port);
-
- void (*get_natural_buffer_sizes) (SCM port, size_t *read_size,
- size_t *write_size);
- int (*random_access_p) (SCM port);
-
- int (*input_waiting) (SCM port);
-
- void (*truncate) (SCM port, scm_t_off length);
-
- unsigned flags;
-} scm_t_ptob_descriptor;
+typedef struct scm_t_ptob_descriptor scm_t_ptob_descriptor;
#define SCM_TC2PTOBNUM(x) (0x0ff & ((x) >> 8))
#define SCM_PTOBNUM(x) (SCM_TC2PTOBNUM (SCM_CELL_TYPE (x)))
- [Guile-commits] 21/21: Bump objcode version, (continued)
- [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, 2016/05/16
- [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 <=
- [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
- [Guile-commits] 03/21: Beginnings of shunting ports-in-scheme off to a module, Andy Wingo, 2016/05/16
- [Guile-commits] 14/21: Use heap-allocated port types instead of ptobnums, Andy Wingo, 2016/05/16
- [Guile-commits] 11/21: Remove scm_t_port_internal, Andy Wingo, 2016/05/16
- [Guile-commits] 06/21: Remove SCM backlink in port structure, Andy Wingo, 2016/05/16
- [Guile-commits] 19/21: Remove unused type from ports-internal, Andy Wingo, 2016/05/16
- [Guile-commits] 05/21: Add random_access_p port type method, Andy Wingo, 2016/05/16