ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/paths.h
(Generate patch)

Comparing ray/src/common/paths.h (file contents):
Revision 2.24 by greg, Fri Jun 29 23:09:06 2012 UTC vs.
Revision 2.30 by greg, Mon Jul 10 20:15:18 2017 UTC

# Line 12 | Line 12
12   #include <sys/types.h>
13   #include <sys/stat.h>
14  
15 < #ifdef _WIN32
15 > #if defined(_WIN32) || defined(_WIN64)
16    #include <io.h>
17    #include <direct.h> /* getcwd(), chdir(), _mkdir(), etc. */
18 +  #define getcwd _getcwd
19 +  #define chdir _chdir
20  
21 <  #define access _access
22 <  #define mkdir(dirname,perms) _mkdir(dirname)
23 <  #define PATH_MAX _MAX_PATH
24 <  #define NULL_DEVICE   "NUL"
21 >  #define access                _access
22 >  #define mkdir(dirname,perms)  _mkdir(dirname)
23 >  /* The windows _popen with the native shell breaks '\\\n' escapes.
24 >   * RT_WINPROC (used by SCons) enables our replacement functions to fix that.
25 >   * XXX This should really not depend on the compiler used! */
26 >  #if defined(_MSC_VER) && !defined(RT_WINPROC)
27 >    #define popen(cmd,mode)     _popen(cmd,mode)
28 >    #define pclose(p)           _pclose(p)
29 >  #else
30 >    #define popen(cmd,mode)     win_popen(cmd,mode)
31 >    #define pclose(p)           win_pclose(p)
32 >  #endif
33 >  #define kill(pid,sig)         win_kill(pid,sig)
34 >  #define nice(inc)             win_nice(inc)
35 >  #define PATH_MAX              _MAX_PATH
36 >  #define NULL_DEVICE           "NUL"
37    #define DIRSEP                '/'
38 <  #define ISDIRSEP(c)   (((c)=='/') | ((c)=='\\'))
39 <  #define ISABS(s)      ( ISDIRSEP((s)[0]) \
38 >  #define ISDIRSEP(c)           (((c)=='/') | ((c)=='\\'))
39 >  #define ISABS(s)              ( ISDIRSEP((s)[0]) \
40                  || ( isupper((s)[0]) | islower((s)[0]) \
41                          && (s)[1]==':' && ISDIRSEP((s)[2]) ) )
42 <  #define CASEDIRSEP    case '/': case '\\'
42 >  #define CASEDIRSEP            case '/': case '\\'
43    #define PATHSEP               ';'
44    #define CURDIR                '.'
45 <  #define DEFAULT_TEMPDIRS {"C:/TMP", "C:/TEMP", ".", NULL}
46 <  #define TEMPLATE      "rtXXXXXX"
45 >  #define DEFAULT_TEMPDIRS      {"C:/TMP", "C:/TEMP", ".", NULL}
46 >  #define TEMPLATE              "rtXXXXXX"
47    #define TEMPLEN               8
48    #define ULIBVAR               "RAYPATH"
49    #ifndef DEFPATH
50      #define DEFPATH             ";c:/ray/lib"
51    #endif
52 +  #define SPECIALS              " \t\"$*?|"
53 +  #define QUOTCHAR              '"'
54    /* <io.h> only does half the work for access() */
55    #ifndef F_OK
56      #define  F_OK 00
# Line 50 | Line 66
66      #define S_IWUSR _S_IWRITE
67    #endif
68  
53  #ifdef __cplusplus
54    extern "C" {
55  #endif
56  extern char  *fixargv0();
57  #ifdef __cplusplus
58    }
59  #endif
60
69   #else /* everything but Windows */
70    #include <unistd.h>
71    #include <sys/param.h>
# Line 77 | Line 85
85      #define ISABS(s)            ISDIRSEP((s)[0])
86      #define PATHSEP             ';'
87          #define CURDIR          '.'
88 <    #define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL}
89 <    #define TEMPLATE    "/tmp/rtXXXXXX"
88 >    #define DEFAULT_TEMPDIRS    {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL}
89 >    #define TEMPLATE            "/tmp/rtXXXXXX"
90      #define TEMPLEN             13
91      #define ULIBVAR             "RAYPATH"
92      #ifndef DEFPATH
# Line 96 | Line 104
104      #define ISABS(s)            ISDIRSEP((s)[0])
105      #define PATHSEP             ':'
106          #define CURDIR          '.'
107 <    #define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL}
108 <    #define TEMPLATE    "/tmp/rtXXXXXX"
109 <    #define TEMPLEN             17
107 >    #define DEFAULT_TEMPDIRS    {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL}
108 >    #define TEMPLATE            "/tmp/rtXXXXXX"
109 >    #define TEMPLEN             13
110      #define ULIBVAR             "RAYPATH"
111      #ifndef DEFPATH
112        #define DEFPATH           ":/usr/local/lib/ray"
113      #endif
114 +    #define SPECIALS            " \t\n'\"()${}*?[];|&"
115 +    #define QUOTCHAR            '\''
116 +    #define ALTQUOT             '"'
117      #define      fixargv0(a0)   (a0)
118  
119    #endif
# Line 118 | Line 129
129   #ifdef __cplusplus
130   extern "C" {
131   #endif
132 +
133 + #if defined(_WIN32) || defined(_WIN64)
134 +  extern FILE *win_popen(char *command, char *type);
135 +  extern int win_pclose(FILE *p);
136 +  extern char  *fixargv0(char *arg0);
137 + #endif
138 +
139 + /* Check if any of the characters in str2 are found in str1 */
140 + extern int matchany(const char *str1, const char *str2);
141 +
142 + /* Convert a set of arguments into a command line for pipe() or system() */
143 + extern char *convert_commandline(char *cmd, const int len, char *av[]);
144  
145   /* Find a writeable directory for temporary files */
146   /* If s is NULL, we return a static string */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines