Upgraded GRUB2 to 2.00 release.
[AROS.git] / compiler / clib / __fdesc.h
blob0a1e0d4acb3456f672ac9d5f69098f01eb48bcd3
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 fh; // if isdir == TRUE: BCPL pointer to struct FileLock
18 // if isdir == FALSE: BCPL pointer to struct FileHandle
19 int flags;
20 unsigned int opencount;
21 char isdir;
22 unsigned char privflags;
23 } fcb;
25 /* privflags */
26 #define _FCB_DONTCLOSE_FH 1
28 /* file descriptor structure - one per descriptor */
29 typedef struct _fdesc
31 fcb *fcb;
32 int fdflags;
33 } fdesc;
35 struct aroscbase;
36 int __register_init_fdarray(struct aroscbase *base);
37 int __getfdslots(void);
38 void __getfdarray(APTR *arrayptr, int *slotsptr);
39 void __setfdarray(APTR array, int slots);
40 void __setfdarraybase(struct aroscbase *base);
41 fdesc *__getfdesc(register int fd);
42 void __setfdesc(register int fd, fdesc *fdesc);
43 int __getfdslot(int wanted_fd);
44 int __getfirstfd(register int startfd);
45 int __open(int wanted_fd, const char *pathname, int flags, int mode);
46 void __updatestdio(void);
47 LONG __oflags2amode(int flags);
48 fdesc *__alloc_fdesc(void);
49 void __free_fdesc(fdesc *fdesc);
50 void __close_on_exec_fdescs(void);
52 #endif /* ___FDESC_H */