* rw.c: new file, implementing C part of module (ice-9 rw).
[bpt/guile.git] / libguile / fports.h
index dcd0f19..3d970d9 100644 (file)
@@ -2,7 +2,7 @@
 
 #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
@@ -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_NIMP(x) && (SCM_TYP16S(x)==scm_tc7_port))
-#define SCM_OPFPORTP(x) (SCM_NIMP(x) && (((0xfeff | SCM_OPN) & SCM_CAR(x))==(scm_tc7_port | SCM_OPN)))
-#define SCM_OPINFPORTP(x) (SCM_NIMP(x) && (((0xfeff | SCM_OPN | SCM_RDNG) & SCM_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG)))
-#define SCM_OPOUTFPORTP(x) (SCM_NIMP(x) && (((0xfeff | SCM_OPN | SCM_WRTNG) & SCM_CAR(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)
@@ -72,10 +74,16 @@ struct scm_fport {
 \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 void scm_init_fports SCM_P ((void));
+extern SCM scm_file_port_p (SCM obj);
+extern void scm_init_fports (void);
 
 #endif  /* FPORTSH */
+
+/*
+  Local Variables:
+  c-file-style: "gnu"
+  End:
+*/