added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / devs / afs / os_unix_support.h
blob3e979d905375e793acb2e4492db38356e1752742
1 #ifndef OS_UNIX_SUPPORT_H
2 #define OS_UNIX_SUPPORT_H
4 /*
5 Copyright © 1995-2003, The AROS Development Team. All rights reserved.
6 $Id$
7 */
9 #include <stdio.h>
10 #include <arpa/inet.h>
12 /* exec/types.h */
13 typedef signed char BYTE;
14 typedef unsigned char UBYTE;
15 typedef signed short WORD;
16 typedef unsigned short UWORD;
17 typedef signed long LONG;
18 typedef unsigned long ULONG;
19 typedef void* APTR;
20 typedef char* STRPTR;
21 typedef unsigned char TEXT;
22 typedef unsigned long IPTR;
23 typedef unsigned long BPTR;
24 typedef short BOOL;
25 #define VOID void
26 #define FALSE 0L
27 #define TRUE 1L
29 struct AFSBase {};
30 struct Device {};
31 struct DeviceList {};
32 struct DriveGeometry {};
33 struct Interrupt {};
34 struct List {};
35 struct Node {};
37 /* libraries/iffparse.h */
38 #define MAKE_ID(a,b,c,d) (((ULONG) (a)<<24) | ((ULONG) (b)<<16) | \
39 ((ULONG) (c)<<8) | ((ULONG) (d)))
41 /* dos/asl.h */
42 #define ERROR_BUFFER_OVERFLOW 303
44 /* dos/dos.h */
45 #define DOSTRUE (-1)
46 #define DOSFALSE 0
47 #define ERROR_UNKNOWN 100
48 #define ERROR_NO_FREE_STORE 103
49 #define ERROR_BAD_NUMBER 115
50 #define ERROR_OBJECT_IN_USE 202
51 #define ERROR_OBJECT_EXISTS 203
52 #define ERROR_OBJECT_NOT_FOUND 205
53 #define ERROR_OBJECT_WRONG_TYPE 212
54 #define ERROR_DISK_WRITE_PROTECTED 214
55 #define ERROR_DIRECTORY_NOT_EMPTY 216
56 #define ERROR_SEEK_ERROR 219
57 #define ERROR_COMMENT_TOO_BIG 220
58 #define ERROR_DISK_FULL 221
59 #define ERROR_DELETE_PROTECTED 222
60 #define ERROR_NOT_A_DOS_DISK 225
61 #define ERROR_NO_MORE_ENTRIES 232
62 #define LOCK_DIFFERENT -1
63 #define LOCK_SAME 0
64 #define OFFSET_BEGINNING -1
65 #define OFFSET_CURRENT 0
66 #define OFFSET_END 1
67 #define FIBB_DELETE 0
68 #define FIBF_DELETE (1<<FIBB_DELETE)
69 #define MAXFILENAMELENGTH 108
70 #define MAXCOMMENTLENGTH 80
71 struct DateStamp {
72 LONG ds_Days;
73 LONG ds_Minute;
74 LONG ds_Tick;
76 struct FileInfoBlock {
77 LONG fib_DiskKey;
78 LONG fib_DirEntryType;
79 UBYTE fib_FileName[MAXFILENAMELENGTH];
80 LONG fib_Protection;
81 LONG fib_EntryType;
82 LONG fib_Size;
83 LONG fib_NumBlocks;
84 struct DateStamp fib_Date;
85 UBYTE fib_Comment[MAXCOMMENTLENGTH];
86 UWORD fib_OwnerUID;
87 UWORD fib_OwnerGID;
89 #define FIBB_DELETE 0
90 #define FIBB_WRITE 2
91 #define FIBB_READ 3
92 #define FIBF_DELETE (1<<FIBB_DELETE)
93 #define FIBF_WRITE (1<<FIBB_WRITE)
94 #define FIBF_READ (1<<FIBB_READ)
95 struct InfoData {
96 LONG id_NumSoftErrors;
97 LONG id_UnitNumber;
98 LONG id_DiskState;
99 LONG id_NumBlocks;
100 LONG id_NumBlocksUsed;
101 LONG id_BytesPerBlock;
102 LONG id_DiskType;
103 BPTR id_VolumeNode;
104 LONG id_InUse;
106 #define ID_WRITE_PROTECTED 80
107 #define ID_VALIDATING 81
108 #define ID_VALIDATED 82
109 #define ID_DOS_DISK MAKE_ID('D','O','S',0)
110 #define ID_FFS_DISK MAKE_ID('D','O','S',1)
111 #define ID_INTER_DOS_DISK MAKE_ID('D','O','S',2)
112 #define ID_INTER_FFS_DISK MAKE_ID('D','O','S',3)
115 /* dos/exall.h */
116 #define ED_NAME 1
117 #define ED_TYPE 2
118 #define ED_SIZE 3
119 #define ED_PROTECTION 4
120 #define ED_DATE 5
121 #define ED_COMMENT 6
122 #define ED_OWNER 7
123 struct ExAllData {
124 struct ExAllData *ed_Next;
125 UBYTE *ed_Name;
126 LONG ed_Type;
127 ULONG ed_Size;
128 ULONG ed_Prot;
129 ULONG ed_Days;
130 ULONG ed_Mins;
131 ULONG ed_Ticks;
132 UBYTE *ed_Comment;
133 UWORD ed_OwnerUID;
134 UWORD ed_OwnerGID;
136 struct ExAllControl {
137 ULONG eac_Entries;
138 ULONG eac_LastKey;
139 UBYTE *eac_MatchString;
140 struct Hook *eac_MatchFunc;
143 /* dos/dosextens.h */
144 #define ST_FILE -3
145 #define ST_ROOT 1
146 #define ST_USERDIR 2
147 #define ST_LINKDIR 4
149 /* dos/stdio.h */
150 #define ENDSTREAMCH -1
152 /* dos/filehandler.h */
153 struct DosEnvec {
154 IPTR de_TableSize;
155 IPTR de_SizeBlock;
156 IPTR de_SecOrg;
157 IPTR de_Surfaces;
158 IPTR de_SectorPerBlock;
159 IPTR de_BlocksPerTrack;
160 IPTR de_Reserved;
161 IPTR de_PerAlloc;
162 IPTR de_Interleave;
163 IPTR de_LowCyl;
164 IPTR de_HighCyl;
165 IPTR de_NumBuffers;
166 IPTR de_BufMemType;
167 IPTR de_MaxTransfer;
168 IPTR de_Mask;
169 IPTR de_BootPri;
170 IPTR de_DosType;
171 IPTR de_Baud;
172 IPTR de_Control;
173 IPTR de_BootBlocks;
176 /* dos/filesystem.h */
177 #define FMF_LOCK (1L<<0)
178 #define FMF_WRITE (1L<<2)
179 #define FMF_READ (1L<<3)
180 #define FMF_CREATE (1L<<4)
181 #define FMF_CLEAR (1L<<5)
183 /* aros/debug.h */
184 #if DEBUG
185 # define D(x) x
186 #else
187 # define D(x)
188 #endif
189 #define bug kprintf
190 #define kprintf printf
192 /* (aros/macros.h) */
193 #define OS_BE2LONG ntohl
194 #define OS_LONG2BE htonl
196 /* (aros/machine.h) */
197 #define OS_PTRALIGN (sizeof(APTR))
199 /* proto/exec.h */
200 APTR AllocMem(ULONG, ULONG);
201 APTR AllocVec(ULONG, ULONG);
202 void CopyMem(APTR, APTR, ULONG);
203 void FreeMem(APTR, ULONG);
204 void FreeVec(APTR);
205 /* exec/memory.h */
206 #define MEMF_PUBLIC (1L<<0)
207 #define MEMF_CLEAR (1L<<16)
209 /* proto/dos.h */
210 struct DateStamp *DateStamp(struct DateStamp *);
211 STRPTR PathPart(STRPTR);
213 /* io */
214 struct IOHandle {
215 STRPTR blockdevice;
216 ULONG unit;
217 ULONG flags;
218 FILE *fh;
219 void *mediachangedata;
220 ULONG ioflags;
223 #define IOHF_DISK_IN (1<<2)
225 #endif