diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-01-25 17:18:41 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-01-25 17:18:41 +0000 |
commit | a98bddfd12b05872eedada5dedbd0e4967ace237 (patch) | |
tree | 999b9250a0392959485aa8fbc7ba9662d4d05ab5 /libguile/fports.h | |
parent | 0419a52877944ff360f44cec75d76f1cb29f4262 (diff) | |
download | guile-a98bddfd12b05872eedada5dedbd0e4967ace237.tar.gz |
* Made the port implementations less tightly coupled within guile.
Diffstat (limited to 'libguile/fports.h')
-rw-r--r-- | libguile/fports.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libguile/fports.h b/libguile/fports.h index d543c63df..8fc992579 100644 --- a/libguile/fports.h +++ b/libguile/fports.h @@ -58,13 +58,15 @@ struct scm_fport { int fdes; /* file descriptor. */ }; +extern scm_bits_t scm_tc16_fport; + #define SCM_FSTREAM(x) ((struct scm_fport *) SCM_STREAM (x)) #define SCM_FPORT_FDES(x) (SCM_FSTREAM (x)->fdes) -#define SCM_FPORTP(x) (!SCM_IMP (x) && (SCM_TYP16S (x) == scm_tc7_port)) -#define SCM_OPFPORTP(x) (!SCM_IMP (x) && (((0xfeff | SCM_OPN) & SCM_CELL_WORD_0 (x)) == (scm_tc7_port | SCM_OPN))) -#define SCM_OPINFPORTP(x) (!SCM_IMP (x) && (((0xfeff | SCM_OPN | SCM_RDNG) & SCM_CELL_WORD_0 (x)) == (scm_tc7_port | SCM_OPN | SCM_RDNG))) -#define SCM_OPOUTFPORTP(x) (!SCM_IMP(x) && (((0xfeff | SCM_OPN | SCM_WRTNG) & SCM_CELL_WORD_0 (x)) == (scm_tc7_port | SCM_OPN | SCM_WRTNG))) +#define SCM_FPORTP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_fport)) +#define SCM_OPFPORTP(x) (SCM_FPORTP (x) && (SCM_CELL_WORD_0 (x) & SCM_OPN)) +#define SCM_OPINFPORTP(x) (SCM_OPFPORTP (x) && (SCM_CELL_WORD_0 (x) & SCM_RDNG)) +#define SCM_OPOUTFPORTP(x) (SCM_OPFPORTP (x) && (SCM_CELL_WORD_0 (x) & SCM_WRTNG)) /* test whether fdes supports random access. */ #define SCM_FDES_RANDOM_P(fdes) ((lseek (fdes, 0, SEEK_CUR) == -1) ? 0 : 1) |