guile-commits
[Top][All Lists]
Advanced

[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)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]