61ddf3c85fadba35bce38614ca31f9e3821c3027
[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  * Copyright 2011 Xamarin Inc
9  * Licensed under the MIT license. See LICENSE file in the project root for full license information.
10  */
11
12 #ifndef _WAPI_IO_PRIVATE_H_
13 #define _WAPI_IO_PRIVATE_H_
14
15 #include <config.h>
16 #include <glib.h>
17 #ifdef HAVE_DIRENT_H
18 #include <dirent.h>
19 #endif
20
21 #include <mono/io-layer/io.h>
22 #include <mono/io-layer/wapi-private.h>
23
24 extern struct _WapiHandleOps _wapi_file_ops;
25 extern struct _WapiHandleOps _wapi_console_ops;
26 extern struct _WapiHandleOps _wapi_find_ops;
27 extern struct _WapiHandleOps _wapi_pipe_ops;
28
29 extern gboolean _wapi_lock_file_region (int fd, off_t offset, off_t length);
30 extern gboolean _wapi_unlock_file_region (int fd, off_t offset, off_t length);
31 extern gpointer _wapi_stdhandle_create (int fd, const gchar *name);
32
33 /* Currently used for both FILE, CONSOLE and PIPE handle types.  This may
34  * have to change in future.
35  */
36 struct _WapiHandle_file
37 {
38         gchar *filename;
39         struct _WapiFileShare *share_info;      /* Pointer into shared mem */
40         int fd;
41         guint32 security_attributes;
42         guint32 fileaccess;
43         guint32 sharemode;
44         guint32 attrs;
45 };
46
47 struct _WapiHandle_find
48 {
49         gchar **namelist;
50         gchar *dir_part;
51         int num;
52         size_t count;
53 };
54
55 #endif /* _WAPI_IO_PRIVATE_H_ */