4
* Basilisk II (C) 1997-1999 Christian Bauer
6
* Windows platform specific code copyright (C) Lauri Pesonen
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version.
13
* This program is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
* GNU General Public License for more details.
18
* You should have received a copy of the GNU General Public License
19
* along with this program; if not, write to the Free Software
20
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31
void init_posix_emu(void);
32
void final_posix_emu(void);
34
typedef struct dirent {
35
char d_name[MAX_PATH_LENGTH];
40
WIN32_FIND_DATA FindFileData;
46
DIR *opendir( const char *path );
47
void closedir( DIR *d );
48
struct dirent *readdir( DIR *d );
50
// access() mode: exists?
54
// access() mode: can do r/w?
59
// hook stat functions to create virtual desktop
60
// because of errno all used funcs must be hooked.
61
int my_stat( const char *, struct my_stat * );
62
int my_fstat( int, struct my_stat * );
63
int my_open( const char *, int, ... );
64
int my_rename( const char *, const char * );
65
int my_access( const char *, int );
66
int my_mkdir( const char *path, int mode );
67
int my_remove( const char * );
68
int my_creat( const char *path, int mode );
69
int my_creat( const char *path, int mode );
70
int my_close( int fd );
71
long my_lseek( int fd, long, int);
72
int my_read( int fd, void *, unsigned int);
73
int my_write( int fd, const void *, unsigned int);
74
int my_chsize( int fd, unsigned int size );
75
int my_locking( int fd, int mode, long nbytes );
79
// must hook all other functions that manipulate file names
80
#ifndef NO_POSIX_API_HOOK
82
#define fstat my_fstat
84
#define rename my_rename
85
#define access my_access
86
#define mkdir my_mkdir
87
#define remove my_remove
88
#define creat my_creat
89
#define close my_close
90
#define lseek my_lseek
92
#define write my_write
93
#define ftruncate my_chsize
94
#define locking my_locking
97
#define errno my_errno
98
#endif //!NO_POSIX_API_HOOK
101
#define S_ISDIR(stat_mode) (((stat_mode) & _S_IFDIR) != 0)
104
// can't #define "stat" unless there's a replacement for "struct stat"
108
unsigned short st_mode;
119
// Your compiler may have different "struct stat" -> edit "struct my_stat"
120
#define validate_stat_struct ( sizeof(struct my_stat) == sizeof(struct stat) )
122
#define st_crtime st_ctime