purely cosmetic commit: edited the introductory comments of several files to uniform...
[reactos.git] / posix / include / psx / fdtable.h
1 /* $Id: fdtable.h,v 1.2 2002/02/20 09:17:55 hyperion Exp $
2 */
3 /*
4 * psx/fdtable.h
5 *
6 * POSIX+ subsystem file descriptor table data structure
7 *
8 * This file is part of the ReactOS Operating System.
9 *
10 * Contributors:
11 * Created by KJK::Hyperion <noog@libero.it>
12 *
13 * THIS SOFTWARE IS NOT COPYRIGHTED
14 *
15 * This source code is offered for use in the public domain. You may
16 * use, modify or distribute it freely.
17 *
18 * This code is distributed in the hope that it will be useful but
19 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20 * DISCLAMED. This includes but is not limited to warranties of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22 *
23 */
24 #ifndef __PSX_FDTABLE_H_INCLUDED__
25 #define __PSX_FDTABLE_H_INCLUDED__
26
27 /* INCLUDES */
28 #include <limits.h>
29 #include <inttypes.h>
30 #include <psx/safeobj.h>
31
32 /* OBJECTS */
33
34 /* TYPES */
35 typedef struct __tagfildes_t
36 {
37 void *FileHandle;
38 int OpenFlags;
39 int FdFlags;
40 size_t ExtraDataSize;
41 void *ExtraData;
42 } __fildes_t;
43
44 typedef struct __tagfdtable_t
45 {
46 __magic_t Signature;
47 int32_t LowestUnusedFileNo;
48 int32_t UsedDescriptors;
49 int32_t AllocatedDescriptors;
50 uint32_t DescriptorsBitmap[OPEN_MAX / 32];
51 __fildes_t *Descriptors;
52 } __fdtable_t;
53
54 /* CONSTANTS */
55
56 /* PROTOTYPES */
57 int __fdtable_init(__fdtable_t *);
58 int __fdtable_free(__fdtable_t *);
59
60 int __fdtable_entry_isavail(__fdtable_t *, int);
61 int __fdtable_entry_nextavail(__fdtable_t *, int);
62 int __fdtable_entry_add(__fdtable_t *, int, __fildes_t *, __fildes_t **);
63 int __fdtable_entry_remove(__fdtable_t *, int);
64 __fildes_t *__fdtable_entry_get(__fdtable_t *, int);
65
66 /* MACROS */
67 #define __FDTABLE_MAGIC MAGIC('F', 'D', 'T', 'B')
68
69 #endif /* __PSX_FDTABLE_H_INCLUDED__ */
70
71 /* EOF */
72