4 |
|
*/ |
5 |
|
#ifndef _RAD_PATHS_H_ |
6 |
|
#define _RAD_PATHS_H_ |
7 |
– |
#ifdef __cplusplus |
8 |
– |
extern "C" { |
9 |
– |
#endif |
7 |
|
|
8 |
|
#include <stdio.h> |
9 |
|
#include <stdlib.h> |
14 |
|
|
15 |
|
#ifdef _WIN32 |
16 |
|
#include <io.h> |
17 |
< |
#include <direct.h> /* getcwd(), chdir(), etc. */ |
17 |
> |
#include <direct.h> /* getcwd(), chdir(), _mkdir(), etc. */ |
18 |
|
|
19 |
|
#define access _access |
20 |
+ |
#define mkdir(dirname,perms) _mkdir(dirname) |
21 |
|
#define PATH_MAX _MAX_PATH |
22 |
+ |
#define NULL_DEVICE "NUL" |
23 |
|
#define DIRSEP '/' |
24 |
|
#define ISDIRSEP(c) ((c)=='/' || (c)=='\\') |
25 |
|
#define ISABS(s) ((s)!=NULL \ |
50 |
|
#define S_IRUSR _S_IREAD |
51 |
|
#define S_IWUSR _S_IWRITE |
52 |
|
#endif |
54 |
– |
extern char *fixargv0(); |
53 |
|
|
54 |
+ |
#ifdef __cplusplus |
55 |
+ |
extern "C" { |
56 |
+ |
#endif |
57 |
+ |
extern char *fixargv0(); |
58 |
+ |
#ifdef __cplusplus |
59 |
+ |
} |
60 |
+ |
#endif |
61 |
+ |
|
62 |
|
#else /* everything but Windows */ |
63 |
|
#include <unistd.h> |
64 |
|
#include <sys/param.h> |
73 |
|
|
74 |
|
#ifdef AMIGA |
75 |
|
|
76 |
+ |
#define NULL_DEVICE "NIL:" |
77 |
|
#define DIRSEP '/' |
78 |
|
#define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) |
79 |
|
#define PATHSEP ';' |
98 |
|
#define PATHSEP ':' |
99 |
|
#define CURDIR '.' |
100 |
|
#define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} |
101 |
< |
#define TEMPLATE "/usr/tmp/rtXXXXXX" |
101 |
> |
#define TEMPLATE "/tmp/rtXXXXXX" |
102 |
|
#define TEMPLEN 17 |
103 |
|
#define ULIBVAR "RAYPATH" |
104 |
|
#ifndef DEFPATH |
116 |
|
#define CASEDIRSEP case DIRSEP |
117 |
|
#endif |
118 |
|
|
119 |
+ |
#ifdef __cplusplus |
120 |
+ |
extern "C" { |
121 |
+ |
#endif |
122 |
|
|
123 |
|
/* Find a writeable directory for temporary files */ |
124 |
|
/* If s is NULL, we return a static string */ |