--- ray/src/common/paths.h 2003/06/30 14:59:11 2.16 +++ ray/src/common/paths.h 2003/07/14 22:23:59 2.19 @@ -1,19 +1,20 @@ -/* RCSid $Id: paths.h,v 2.16 2003/06/30 14:59:11 schorsch Exp $ */ +/* RCSid $Id: paths.h,v 2.19 2003/07/14 22:23:59 schorsch Exp $ */ /* * Definitions for paths on different machines */ #ifndef _RAD_PATHS_H_ #define _RAD_PATHS_H_ -#ifdef __cplusplus -extern "C" { -#endif #include #include #include +#include +#include +#include #ifdef _WIN32 #include + #include /* getcwd(), chdir(), etc. */ #define access _access #define PATH_MAX _MAX_PATH @@ -28,7 +29,6 @@ extern "C" { #define CASEDIRSEP case '/': case '\\' #define PATHSEP ';' #define CURDIR '.' - /*#define MAXPATH 512*/ /* obsoleted by posix PATH_MAX */ #define DEFAULT_TEMPDIRS {"C:/TMP", "C:/TEMP", ".", NULL} #define TEMPLATE "rtXXXXXX" #define TEMPLEN 8 @@ -43,8 +43,20 @@ extern "C" { #define W_OK 02 #define R_OK 04 #endif -extern char *fixargv0(); + /* to make the permissions user specific we'd need to use CreateFile() */ + #ifndef S_IRUSR + #define S_IRUSR _S_IREAD + #define S_IWUSR _S_IWRITE + #endif + #ifdef __cplusplus + extern "C" { + #endif + extern char *fixargv0(); + #ifdef __cplusplus + } + #endif + #else /* everything but Windows */ #include #include @@ -63,7 +75,6 @@ extern char *fixargv0(); #define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) #define PATHSEP ';' #define CURDIR '.' - /*#define MAXPATH 128*/ /* obsoleted by posix PATH_MAX */ #define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} #define TEMPLATE "/tmp/rtXXXXXX" #define TEMPLEN 13 @@ -83,7 +94,6 @@ extern char *fixargv0(); #define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) #define PATHSEP ':' #define CURDIR '.' - /*#define MAXPATH 256*/ /* obsoleted by posix PATH_MAX */ #define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} #define TEMPLATE "/usr/tmp/rtXXXXXX" #define TEMPLEN 17 @@ -103,6 +113,9 @@ extern char *fixargv0(); #define CASEDIRSEP case DIRSEP #endif +#ifdef __cplusplus +extern "C" { +#endif /* Find a writeable directory for temporary files */ /* If s is NULL, we return a static string */