1 #ifndef OS_UNIX_SUPPORT_H
2 #define OS_UNIX_SUPPORT_H
5 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
13 /* We can't just #include <winsock2.h> because many definitions will conflict */
14 __declspec(dllimport
) __stdcall
unsigned long htonl(unsigned long);
15 __declspec(dllimport
) __stdcall
unsigned long ntohl(unsigned long);
18 #include <arpa/inet.h>
23 typedef uint8_t UBYTE
;
25 typedef uint16_t UWORD
;
27 typedef uint32_t ULONG
;
30 typedef const char *CONST_STRPTR
;
31 typedef unsigned char TEXT
;
32 typedef uintptr_t IPTR
;
33 typedef intptr_t SIPTR
;
34 typedef uintptr_t BPTR
;
44 struct DriveGeometry
{};
49 /* libraries/iffparse.h */
50 #define MAKE_ID(a,b,c,d) (((ULONG) (a)<<24) | ((ULONG) (b)<<16) | \
51 ((ULONG) (c)<<8) | ((ULONG) (d)))
54 #define ERROR_BUFFER_OVERFLOW 303
57 #define BADDR(x) ((void *)(x)) // Convert from BPTR to pointer.
58 #define MKBADDR(x) ((BPTR)(x)) // Convert from pointer to BPTR.
64 #define ERROR_UNKNOWN 100
65 #define ERROR_NO_FREE_STORE 103
66 #define ERROR_BAD_NUMBER 115
67 #define ERROR_LINE_TOO_LONG 120
68 #define ERROR_OBJECT_IN_USE 202
69 #define ERROR_OBJECT_EXISTS 203
70 #define ERROR_OBJECT_NOT_FOUND 205
71 #define ERROR_INVALID_COMPONENT_NAME 210
72 #define ERROR_OBJECT_WRONG_TYPE 212
73 #define ERROR_DISK_WRITE_PROTECTED 214
74 #define ERROR_DIRECTORY_NOT_EMPTY 216
75 #define ERROR_SEEK_ERROR 219
76 #define ERROR_COMMENT_TOO_BIG 220
77 #define ERROR_DISK_FULL 221
78 #define ERROR_DELETE_PROTECTED 222
79 #define ERROR_NOT_A_DOS_DISK 225
80 #define ERROR_NO_DISK 226
81 #define ERROR_NO_MORE_ENTRIES 232
82 #define LOCK_DIFFERENT -1
84 #define OFFSET_BEGINNING -1
85 #define OFFSET_CURRENT 0
88 #define FIBF_DELETE (1<<FIBB_DELETE)
89 #define MAXFILENAMELENGTH 108
90 #define MAXCOMMENTLENGTH 80
96 struct FileInfoBlock
{
98 LONG fib_DirEntryType
;
99 UBYTE fib_FileName
[MAXFILENAMELENGTH
];
104 struct DateStamp fib_Date
;
105 UBYTE fib_Comment
[MAXCOMMENTLENGTH
];
109 #define FIBB_DELETE 0
112 #define FIBF_DELETE (1<<FIBB_DELETE)
113 #define FIBF_WRITE (1<<FIBB_WRITE)
114 #define FIBF_READ (1<<FIBB_READ)
116 LONG id_NumSoftErrors
;
120 LONG id_NumBlocksUsed
;
121 LONG id_BytesPerBlock
;
127 #define ID_WRITE_PROTECTED 80
128 #define ID_VALIDATING 81
129 #define ID_VALIDATED 82
130 #define ID_NO_DISK_PRESENT (-1L)
132 #define ID_UNREADABLE_DISK MAKE_ID('B','A','D',0)
133 #define ID_DOS_DISK MAKE_ID('D','O','S',0)
134 #define ID_FFS_DISK MAKE_ID('D','O','S',1)
135 #define ID_INTER_DOS_DISK MAKE_ID('D','O','S',2)
136 #define ID_INTER_FFS_DISK MAKE_ID('D','O','S',3)
137 #define ID_NOT_REALLY_DOS MAKE_ID('N','D','O','S')
143 #define ED_PROTECTION 4
148 struct ExAllData
*ed_Next
;
160 struct ExAllControl
{
163 UBYTE
*eac_MatchString
;
164 struct Hook
*eac_MatchFunc
;
167 /* dos/dosextens.h */
174 #define ENDSTREAMCH -1
176 /* dos/filehandler.h */
182 IPTR de_SectorPerBlock
;
183 IPTR de_BlocksPerTrack
;
201 #define MODE_READWRITE 1004
202 #define MODE_OLDFILE 1005
203 #define MODE_NEWFILE 1006
212 #define kprintf printf
214 /* (aros/macros.h) */
215 #define OS_BE2LONG ntohl
216 #define OS_LONG2BE htonl
218 /* (aros/machine.h) */
219 #define OS_PTRALIGN (sizeof(APTR))
222 APTR
AllocMem(ULONG
, ULONG
);
223 APTR
AllocVec(ULONG
, ULONG
);
224 void CopyMem(const void *, APTR
, ULONG
);
225 void FreeMem(APTR
, ULONG
);
228 #define MEMF_PUBLIC (1L<<0)
229 #define MEMF_CLEAR (1L<<16)
232 struct DateStamp
*DateStamp(struct DateStamp
*);
233 CONST_STRPTR
PathPart(CONST_STRPTR
);
241 void *mediachangedata
;
245 #define IOHF_DISK_IN (1<<2)
247 void showText(struct AFSBase
*, const char * const, ...);
248 LONG
showError(struct AFSBase
*, ULONG
, ...);
249 LONG
showRetriableError(struct AFSBase
*, TEXT
*, ...);