-
Notifications
You must be signed in to change notification settings - Fork 3
/
file_sys.h
95 lines (83 loc) · 1.92 KB
/
file_sys.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/*
* Wrapper file for an uniform file system interface for different compilers.
*/
#include "hw-types.h"
#if defined (__PUREC__)
# include <tos.h>
# define F_xattr(f,n,a) Fxattr (f, n, a)
# define D_xreaddir(s,d,b,x,r) Dxreaddir (s, d, b, x, r)
#elif defined (LATTICE)
# include <dos.h>
# include <mintbind.h>
# define DTA struct FILEINFO
# define d_attrib attr
# define d_length size
# define d_time time
# define d_fname name
# include <fcntl.h>
# define F_xattr(f,n,a) Fxattr (f, (char*)n, a)
# define D_xreaddir(s,d,b,x,r) Dxreaddir (s, d, b, (long*)x, r)
#elif defined (__GNUC__)
# include <unistd.h>
# include <mintbind.h>
# define DTA _DTA
# define d_attrib dta_attribute
# define d_length dta_size
# define d_time dta_time
# define d_date dta_date
# define d_fname dta_name
# include <fcntl.h>
# define F_xattr(f,n,a) Fxattr (f, n, a)
# define D_xreaddir(s,d,b,x,r) Dxreaddir (s, d, b, x, r)
#endif
#ifndef O_RAW /* Lattice uses this for open() to write binary files */
# define O_RAW 0
#endif
#ifndef S_ISDIR
# define S_ISDIR(mode) (((mode) & 0170000) == (0040000))
#endif
#if !defined(__XATTR)
#define __XATTR
struct xattr {
UWORD st_mode;
LONG st_ino;
UWORD st_dev;
UWORD st_rdev;
UWORD st_nlink;
UWORD st_uid;
UWORD st_gid;
ULONG st_size;
LONG st_blksize;
LONG st_blocks;
struct {
union {
unsigned long tv_sec; /* actually time&date in DOSTIME format */
struct {
unsigned short time;
unsigned short date;
} d;
} u;
} st_mtim;
struct {
union {
unsigned long tv_sec; /* actually time&date in DOSTIME format */
struct {
unsigned short time;
unsigned short date;
} d;
} u;
} st_atim;
struct {
union {
unsigned long tv_sec; /* actually time&date in DOSTIME format */
struct {
unsigned short time;
unsigned short date;
} d;
} u;
} st_ctim;
UWORD st_attr;
UWORD reserved2;
ULONG reserved3[2];
};
#endif