intuition.library: remove not needed include
[AROS.git] / compiler / posixc / __fdesc.h
blob88b6e5b5ad82279e79588f7b7035376f6eacc444
1 #ifndef ___FDESC_H
2 #define ___FDESC_H
4 /*
5 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: file descriptors handling internals - header file
9 Lang: english
12 #include <dos/dos.h>
14 /* file control block - one per file handle */
15 typedef struct _fcb
17 BPTR handle;// if privflags has flag _FCB_ISDIR: BCPL pointer to struct FileLock
18 // otherwise: BCPL pointer to struct FileHandle
19 int flags;
20 unsigned int opencount;
21 unsigned int privflags;
22 } fcb;
24 /* privflags */
25 #define _FCB_ISDIR ((unsigned int)1<<0)
26 #define _FCB_DONTCLOSE_FH ((unsigned int)1<<1)
27 #define _FCB_FLUSHONREAD ((unsigned int)1<<2)
29 #define FLUSHONREADCHECK \
30 if (__builtin_expect(fdesc->fcb->privflags & _FCB_FLUSHONREAD, 0)) \
31 { \
32 fdesc->fcb->privflags &= ~_FCB_FLUSHONREAD; \
33 Flush(fdesc->fcb->handle); \
36 /* file descriptor structure - one per descriptor */
37 typedef struct _fdesc
39 fcb *fcb;
40 int fdflags;
41 } fdesc;
43 struct PosixCIntBase;
44 int __getfdslots(void);
45 void __getfdarray(APTR *arrayptr, int *slotsptr);
46 void __setfdarray(APTR array, int slots);
47 void __setfdarraybase(struct PosixCIntBase *PosixCBase2);
48 fdesc *__getfdesc(register int fd);
49 void __setfdesc(register int fd, fdesc *fdesc);
50 int __getfdslot(int wanted_fd);
51 int __getfirstfd(register int startfd);
52 int __open(int wanted_fd, const char *pathname, int flags, int mode);
53 void __updatestdio(void);
54 LONG __oflags2amode(int flags);
55 fdesc *__alloc_fdesc(void);
56 void __free_fdesc(fdesc *fdesc);
57 void __close_on_exec_fdescs(void);
59 #endif /* ___FDESC_H */