X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fsysfile.h;h=a8f5405e8c5a0c7a3b4a7d1d71fa64771298ecf0;hb=4f14f955e64fbf24dd2f85fc22c2976c5aad47a0;hp=f573ce3eb2e685988c73361c1dd68c5a298637d1;hpb=2fd9701a4f902054649dde9143a3f77809afee8f;p=chise%2Fxemacs-chise.git- diff --git a/src/sysfile.h b/src/sysfile.h index f573ce3..a8f5405 100644 --- a/src/sysfile.h +++ b/src/sysfile.h @@ -24,9 +24,8 @@ Boston, MA 02111-1307, USA. */ #define INCLUDED_sysfile_h_ #include -#include -#ifndef WINDOWSNT +#ifndef WIN32_NATIVE #include /* does not always imply this */ #endif @@ -44,17 +43,26 @@ Boston, MA 02111-1307, USA. */ #ifndef makedev #include /* some typedefs are used in sys/file.h */ #endif + +#ifndef WIN32_NATIVE #include +#endif + #include + +#ifndef WIN32_NATIVE +/* Some configuration files' definitions for the LOAD_AVE_CVT macro + (like sparc.h's) use macros like FSCALE, defined here. */ #include +#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 #endif /* NeXT */ -#ifdef WINDOWSNT +#ifdef WIN32_NATIVE #include #include #endif @@ -95,7 +103,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) @@ -118,6 +126,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" @@ -138,7 +170,7 @@ Boston, MA 02111-1307, USA. */ In that case, use ordinary stat instead. */ #ifndef S_IFLNK -#define lstat stat +#define lstat xemacs_stat #endif #if !S_IRUSR @@ -223,8 +255,21 @@ Boston, MA 02111-1307, USA. */ # 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 @@ -396,24 +441,13 @@ int sys_fstat (int fd, struct stat *buf); #endif #if defined (ENCAPSULATE_FSTAT) && !defined (DONT_ENCAPSULATE) # undef fstat -/* Need to use arguments to avoid messing with struct stat */ -# define fstat(fd, buf) sys_fstat (fd, buf) +# define fstat sys_fstat #endif #if !defined (ENCAPSULATE_FSTAT) && defined (DONT_ENCAPSULATE) # define sys_fstat fstat #endif -#ifdef ENCAPSULATE_STAT -int sys_stat (const char *path, struct stat *buf); -#endif -#if defined (ENCAPSULATE_STAT) && !defined (DONT_ENCAPSULATE) -# undef stat -/* Need to use arguments to avoid messing with struct stat */ -# define stat(path, buf) sys_stat (path, buf) -#endif -#if !defined (ENCAPSULATE_STAT) && defined (DONT_ENCAPSULATE) -# define sys_stat stat -#endif +int xemacs_stat (const char *path, struct stat *buf); /* encapsulations: file-manipulation calls */