* Separate the handling of OPEN flags between ports and directories.
[bpt/guile.git] / libguile / filesys.h
index 6d3ea1f..c71d844 100644 (file)
@@ -2,7 +2,7 @@
 
 #ifndef FILESYSH
 #define FILESYSH
-/*     Copyright (C) 1995,1997,1998, 1999 Free Software Foundation, Inc.
+/*     Copyright (C) 1995,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
 
 \f
 
-extern long scm_tc16_dir;
-#define SCM_DIRP(x) (SCM_NIMP(x) && (SCM_TYP16(x)==(scm_tc16_dir)))
-#define SCM_OPDIRP(x) (SCM_NIMP(x) && (SCM_UNPACK_CAR(x)==(scm_tc16_dir | SCM_OPN)))
+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_DIR_OPEN_P(x) (SCM_CELL_WORD_0 (x) & SCM_DIR_FLAG_OPEN)
+
 \f
 
 extern SCM scm_chown (SCM object, SCM owner, SCM group);
@@ -63,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);
@@ -88,4 +93,18 @@ 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 */
+
+/*
+  Local Variables:
+  c-file-style: "gnu"
+  End:
+*/