import -ko -b 1.1.3 XEmacs XEmacs-21_2 r21-2-35
[chise/xemacs-chise.git.1] / src / sysfile.h
index 69179b7..f5f7490 100644 (file)
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA.  */
 
 #include <errno.h>
 
-#ifndef WINDOWSNT
+#ifndef WIN32_NATIVE
 #include <sys/errno.h>          /* <errno.h> does not always imply this */
 #endif
 
@@ -43,17 +43,24 @@ Boston, MA 02111-1307, USA.  */
 #ifndef makedev
 #include <sys/types.h>         /* some typedefs are used in sys/file.h */
 #endif
+
+#ifndef WIN32_NATIVE
 #include <sys/file.h>
+#endif
+
 #include <sys/stat.h>
+
+#ifndef WIN32_NATIVE
 #include <sys/param.h>
+#endif
 
-#if defined (NeXT) || defined(__CYGWIN32__)
+#if defined (NeXT) || defined(CYGWIN)
 /* what is needed from here?  Do others need it too?
  O_BINARY is in here under cygwin. */
 # include <sys/fcntl.h>
 #endif /* NeXT */
 
-#ifdef WINDOWSNT
+#ifdef WIN32_NATIVE
 #include <io.h>
 #include <direct.h>
 #endif
@@ -94,7 +101,7 @@ Boston, MA 02111-1307, USA.  */
 #endif
 
 #ifndef CREAT_MODE
-#ifdef WINDOWSNT
+#ifdef WIN32_NATIVE
 #define CREAT_MODE     (S_IREAD | S_IWRITE)
 #else
 #define CREAT_MODE     (0666)
@@ -117,6 +124,30 @@ Boston, MA 02111-1307, USA.  */
 #endif
 #endif
 
+#ifndef READ_PLUS_TEXT
+#ifdef O_TEXT
+#define READ_PLUS_TEXT "r+t"
+#else
+#define READ_PLUS_TEXT "r+"
+#endif
+#endif
+
+#ifndef READ_PLUS_BINARY
+#ifdef O_BINARY
+#define READ_PLUS_BINARY "r+b"
+#else
+#define READ_PLUS_BINARY "r+"
+#endif
+#endif
+
+#ifndef WRITE_TEXT
+#ifdef O_TEXT
+#define WRITE_TEXT "wt"
+#else
+#define WRITE_TEXT "w"
+#endif
+#endif
+
 #ifndef WRITE_BINARY
 #ifdef O_BINARY
 #define WRITE_BINARY "wb"
@@ -206,13 +237,37 @@ Boston, MA 02111-1307, USA.  */
 #define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
 #endif
 
+/* Client .c files should simply use `PATH_MAX'. */
+#ifndef PATH_MAX
+# if defined (_POSIX_PATH_MAX)
+#  define PATH_MAX _POSIX_PATH_MAX
+# elif defined (MAXPATHLEN)
+#  define PATH_MAX MAXPATHLEN
+# else
+#  define PATH_MAX 1024
+# endif
+#endif
+
+/* MAXPATHLEN is deprecated, but, as of this writing, still used. */
 #ifndef MAXPATHLEN
-/* in 4.1, param.h fails to define this. */
-#define MAXPATHLEN 1024
-#endif /* not MAXPATHLEN */
+# define MAXPATHLEN 1024
+#endif
 
+/* The following definitions are needed under Windows, at least */
 #ifndef X_OK
-# define X_OK 01
+# define X_OK 1
+#endif
+
+#ifndef R_OK
+# define R_OK 4
+#endif
+
+#ifndef W_OK
+# define W_OK 2
+#endif
+
+#ifndef F_OK
+# define F_OK 0
 #endif
 
 #ifndef FD_CLOEXEC