11 |
|
#include <stdio.h> |
12 |
|
#include <stdlib.h> |
13 |
|
#include <string.h> |
14 |
+ |
#include <fcntl.h> |
15 |
+ |
#include <sys/types.h> |
16 |
+ |
#include <sys/stat.h> |
17 |
|
|
18 |
|
#ifdef _WIN32 |
19 |
|
#include <io.h> |
20 |
+ |
#include <direct.h> /* getcwd(), chdir(), etc. */ |
21 |
|
|
22 |
|
#define access _access |
23 |
|
#define PATH_MAX _MAX_PATH |
32 |
|
#define CASEDIRSEP case '/': case '\\' |
33 |
|
#define PATHSEP ';' |
34 |
|
#define CURDIR '.' |
31 |
– |
/*#define MAXPATH 512*/ /* obsoleted by posix PATH_MAX */ |
35 |
|
#define DEFAULT_TEMPDIRS {"C:/TMP", "C:/TEMP", ".", NULL} |
36 |
|
#define TEMPLATE "rtXXXXXX" |
37 |
|
#define TEMPLEN 8 |
46 |
|
#define W_OK 02 |
47 |
|
#define R_OK 04 |
48 |
|
#endif |
49 |
+ |
/* to make the permissions user specific we'd need to use CreateFile() */ |
50 |
+ |
#ifndef S_IRUSR |
51 |
+ |
#define S_IRUSR _S_IREAD |
52 |
+ |
#define S_IWUSR _S_IWRITE |
53 |
+ |
#endif |
54 |
|
extern char *fixargv0(); |
55 |
|
|
56 |
|
#else /* everything but Windows */ |
71 |
|
#define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) |
72 |
|
#define PATHSEP ';' |
73 |
|
#define CURDIR '.' |
66 |
– |
/*#define MAXPATH 128*/ /* obsoleted by posix PATH_MAX */ |
74 |
|
#define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} |
75 |
|
#define TEMPLATE "/tmp/rtXXXXXX" |
76 |
|
#define TEMPLEN 13 |
90 |
|
#define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) |
91 |
|
#define PATHSEP ':' |
92 |
|
#define CURDIR '.' |
86 |
– |
/*#define MAXPATH 256*/ /* obsoleted by posix PATH_MAX */ |
93 |
|
#define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} |
94 |
|
#define TEMPLATE "/usr/tmp/rtXXXXXX" |
95 |
|
#define TEMPLEN 17 |