#ifndef FPORTSH
#define FPORTSH
-/* Copyright (C) 1995,1996,1997,1998,1999 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,1999, 2000 Free Software Foundation, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
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_NIMP(x) && (SCM_TYP16S(x)==scm_tc7_port))
-#define SCM_OPFPORTP(x) (SCM_NIMP(x) && (((0xfeff | SCM_OPN) & SCM_CARBITS (x))==(scm_tc7_port | SCM_OPN)))
-#define SCM_OPINFPORTP(x) (SCM_NIMP(x) && (((0xfeff | SCM_OPN | SCM_RDNG) & SCM_CARBITS (x))==(scm_tc7_port | SCM_OPN | SCM_RDNG)))
-#define SCM_OPOUTFPORTP(x) (SCM_NIMP(x) && (((0xfeff | SCM_OPN | SCM_WRTNG) & SCM_CARBITS (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)
\f
extern SCM scm_setbuf0 (SCM port);
extern SCM scm_setvbuf (SCM port, SCM mode, SCM size);
-extern void scm_setfileno (FILE *fs, int fd);
extern void scm_evict_ports (int fd);
extern SCM scm_open_file (SCM filename, SCM modes);
extern SCM scm_fdes_to_port (int fdes, char *mode, SCM name);
+extern SCM scm_file_port_p (SCM obj);
extern void scm_init_fports (void);
#endif /* FPORTSH */
+
+/*
+ Local Variables:
+ c-file-style: "gnu"
+ End:
+*/