* Separate the handling of OPEN flags between ports and directories.
[bpt/guile.git] / libguile / filesys.h
index f20240a..c71d844 100644 (file)
 
 \f
 
-extern long scm_tc16_dir;
+extern scm_bits_t scm_tc16_dir;
+
+#define SCM_DIR_FLAG_OPEN (1L << 16)
+
 #define SCM_DIRP(x) (!SCM_IMP (x) && (SCM_TYP16 (x) == scm_tc16_dir))
-#define SCM_OPDIRP(x) (!SCM_IMP (x) && (SCM_CELL_WORD_0 (x) == (scm_tc16_dir | SCM_OPN)))
+#define SCM_DIR_OPEN_P(x) (SCM_CELL_WORD_0 (x) & SCM_DIR_FLAG_OPEN)
 
 \f
 
@@ -64,6 +67,7 @@ extern SCM scm_umask (SCM mode);
 extern SCM scm_open_fdes (SCM path, SCM flags, SCM mode);
 extern SCM scm_open (SCM path, SCM flags, SCM mode);
 extern SCM scm_close (SCM fd_or_port);
+extern SCM scm_close_fdes (SCM fd);
 extern SCM scm_stat (SCM object);
 extern SCM scm_link (SCM oldpath, SCM newpath);
 extern SCM scm_rename (SCM oldname, SCM newname);
@@ -89,6 +93,14 @@ extern SCM scm_basename (SCM filename, SCM suffix);
 
 extern void scm_init_filesys (void);
 
+\f
+
+#if (SCM_DEBUG_DEPRECATED == 0)
+
+#define SCM_OPDIRP(x) (SCM_DIRP (x) && (SCM_DIR_OPEN_P (x)))
+
+#endif  /* SCM_DEBUG_DEPRECATED == 0 */
+
 #endif  /* FILESYSH */
 
 /*