--- ray/src/common/paths.h 2003/06/30 14:59:11 2.16 +++ ray/src/common/paths.h 2005/09/19 11:30:10 2.22 @@ -1,22 +1,25 @@ -/* RCSid $Id: paths.h,v 2.16 2003/06/30 14:59:11 schorsch Exp $ */ +/* RCSid $Id: paths.h,v 2.22 2005/09/19 11:30:10 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(), _mkdir(), etc. */ #define access _access + #define mkdir(dirname,perms) _mkdir(dirname) #define PATH_MAX _MAX_PATH + #define NULL_DEVICE "NUL" #define DIRSEP '/' #define ISDIRSEP(c) ((c)=='/' || (c)=='\\') #define ISABS(s) ((s)!=NULL \ @@ -28,7 +31,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 +45,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 @@ -59,11 +73,11 @@ extern char *fixargv0(); #ifdef AMIGA + #define NULL_DEVICE "NIL:" #define DIRSEP '/' #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,9 +97,8 @@ 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 TEMPLATE "/tmp/rtXXXXXX" #define TEMPLEN 17 #define ULIBVAR "RAYPATH" #ifndef DEFPATH @@ -103,6 +116,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 */