mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 03:30:27 +02:00
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.
This commit is contained in:
parent
af1c443f83
commit
17f90360b6
3 changed files with 33 additions and 30 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue