| 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> |
| 31 |
|
#define CASEDIRSEP case '/': case '\\' |
| 32 |
|
#define PATHSEP ';' |
| 33 |
|
#define CURDIR '.' |
| 31 |
– |
/*#define MAXPATH 512*/ /* obsoleted by posix PATH_MAX */ |
| 34 |
|
#define DEFAULT_TEMPDIRS {"C:/TMP", "C:/TEMP", ".", NULL} |
| 35 |
|
#define TEMPLATE "rtXXXXXX" |
| 36 |
|
#define TEMPLEN 8 |
| 45 |
|
#define W_OK 02 |
| 46 |
|
#define R_OK 04 |
| 47 |
|
#endif |
| 48 |
+ |
/* to make the permissions user specific we'd need to use CreateFile() */ |
| 49 |
+ |
#ifndef S_IRUSR |
| 50 |
+ |
#define S_IRUSR _S_IREAD |
| 51 |
+ |
#define S_IWUSR _S_IWRITE |
| 52 |
+ |
#endif |
| 53 |
|
extern char *fixargv0(); |
| 54 |
|
|
| 55 |
|
#else /* everything but Windows */ |
| 70 |
|
#define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) |
| 71 |
|
#define PATHSEP ';' |
| 72 |
|
#define CURDIR '.' |
| 66 |
– |
/*#define MAXPATH 128*/ /* obsoleted by posix PATH_MAX */ |
| 73 |
|
#define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} |
| 74 |
|
#define TEMPLATE "/tmp/rtXXXXXX" |
| 75 |
|
#define TEMPLEN 13 |
| 89 |
|
#define ISABS(s) ((s)!=NULL && (ISDIRSEP(s[0]))) |
| 90 |
|
#define PATHSEP ':' |
| 91 |
|
#define CURDIR '.' |
| 86 |
– |
/*#define MAXPATH 256*/ /* obsoleted by posix PATH_MAX */ |
| 92 |
|
#define DEFAULT_TEMPDIRS {"/var/tmp", "/usr/tmp", "/tmp", ".", NULL} |
| 93 |
|
#define TEMPLATE "/usr/tmp/rtXXXXXX" |
| 94 |
|
#define TEMPLEN 17 |