diff options
author | Andy Wingo <wingo@pobox.com> | 2016-05-13 17:14:59 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-05-13 17:14:59 +0200 |
commit | 17f90360b6057034135ec93ffae340fa514208af (patch) | |
tree | f98a25005d5ad50e44d76e3f2ee093aef1255e57 | |
parent | af1c443f83b492d97cba80648d9f3d7299440978 (diff) |
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.
-rw-r--r-- | libguile/goops.c | 1 | ||||
-rw-r--r-- | libguile/ports-internal.h | 31 | ||||
-rw-r--r-- | libguile/ports.h | 31 |
3 files changed, 33 insertions, 30 deletions
diff --git a/libguile/goops.c b/libguile/goops.c index 1f7ec90c8..cb9b6a612 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 e56d40ba1..394eaf8f5 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 f90a6b6c5..18de70f65 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))) |