2004-09-24 Dick Porter <dick@ximian.com>
[mono.git] / mono / io-layer / io-private.h
1 /*
2  * io-private.h:  Private definitions for file, console and find handles
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #ifndef _WAPI_IO_PRIVATE_H_
11 #define _WAPI_IO_PRIVATE_H_
12
13 #include <config.h>
14 #include <glib.h>
15 #include <dirent.h>
16 #include <mono/io-layer/io.h>
17
18 extern struct _WapiHandleOps _wapi_file_ops;
19 extern struct _WapiHandleOps _wapi_console_ops;
20 extern struct _WapiHandleOps _wapi_find_ops;
21 extern struct _WapiHandleOps _wapi_pipe_ops;
22
23 /* Currently used for both FILE, CONSOLE and PIPE handle types.  This may
24  * have to change in future.
25  */
26 struct _WapiHandle_file
27 {
28         guint32 filename;
29         guint32 security_attributes;
30         guint32 fileaccess;
31         guint32 sharemode;
32         guint32 attrs;
33         dev_t device;
34         ino_t inode;
35 };
36
37 struct _WapiHandlePrivate_file
38 {
39         WapiFDMapped fd_mapped;
40         gboolean async;
41         WapiOverlappedCB callback;
42 };
43
44 struct _WapiHandle_find
45 {
46         int dummy;
47 };
48
49 struct _WapiHandlePrivate_find
50 {
51         gchar **namelist;
52         gchar *dir_part;
53         int num;
54         size_t count;
55 };
56
57 G_BEGIN_DECLS
58 int _wapi_file_handle_to_fd (gpointer handle);
59 gboolean _wapi_io_add_callback (gpointer handle,
60                                 WapiOverlappedCB callback,
61                                 guint64 flags);
62 G_END_DECLS
63
64 #endif /* _WAPI_IO_PRIVATE_H_ */