1 | /* $Id: vboxsf.h 76553 2019-01-01 01:45:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Shared folders - Haiku Guest Additions, header.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2012-2019 Oracle Corporation
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
10 | * available from http://www.virtualbox.org. This file is free software;
|
---|
11 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
12 | * General Public License (GPL) as published by the Free Software
|
---|
13 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | */
|
---|
17 |
|
---|
18 | /*
|
---|
19 | * This code is based on:
|
---|
20 | *
|
---|
21 | * VirtualBox Guest Additions for Haiku.
|
---|
22 | * Copyright (c) 2011 Mike Smith <[email protected]>
|
---|
23 | *
|
---|
24 | * Permission is hereby granted, free of charge, to any person
|
---|
25 | * obtaining a copy of this software and associated documentation
|
---|
26 | * files (the "Software"), to deal in the Software without
|
---|
27 | * restriction, including without limitation the rights to use,
|
---|
28 | * copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
29 | * copies of the Software, and to permit persons to whom the
|
---|
30 | * Software is furnished to do so, subject to the following
|
---|
31 | * conditions:
|
---|
32 | *
|
---|
33 | * The above copyright notice and this permission notice shall be
|
---|
34 | * included in all copies or substantial portions of the Software.
|
---|
35 | *
|
---|
36 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
---|
37 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
---|
38 | * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
---|
39 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
---|
40 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
---|
41 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
---|
42 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
---|
43 | * OTHER DEALINGS IN THE SOFTWARE.
|
---|
44 | */
|
---|
45 |
|
---|
46 | #ifndef ___vboxsf_h
|
---|
47 | #define ___vboxsf_h
|
---|
48 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
49 | # pragma once
|
---|
50 | #endif
|
---|
51 |
|
---|
52 | #include <malloc.h>
|
---|
53 | #include <dirent.h>
|
---|
54 | #include <fs_info.h>
|
---|
55 | #include <sys/stat.h>
|
---|
56 | #include <fs_interface.h>
|
---|
57 | #include <KernelExport.h>
|
---|
58 | #include <VBoxGuest-haiku.h>
|
---|
59 | #include <VBox/VBoxGuestLibSharedFolders.h>
|
---|
60 | #include "lock.h"
|
---|
61 |
|
---|
62 | typedef struct vboxsf_volume
|
---|
63 | {
|
---|
64 | VBGLSFMAP map;
|
---|
65 | ino_t rootid;
|
---|
66 | } vboxsf_volume;
|
---|
67 |
|
---|
68 | typedef struct vboxsf_vnode
|
---|
69 | {
|
---|
70 | PVBGLSFMAP map;
|
---|
71 | PSHFLSTRING name;
|
---|
72 | PSHFLSTRING path;
|
---|
73 | ino_t vnode;
|
---|
74 | struct vboxsf_vnode* next;
|
---|
75 | } vboxsf_vnode;
|
---|
76 |
|
---|
77 | typedef struct vboxsf_dir_cookie
|
---|
78 | {
|
---|
79 | SHFLHANDLE handle;
|
---|
80 | PSHFLSTRING path;
|
---|
81 | uint32_t index;
|
---|
82 | bool has_more_files;
|
---|
83 | PSHFLDIRINFO buffer_start, buffer;
|
---|
84 | uint32_t buffer_length, num_files;
|
---|
85 | } vboxsf_dir_cookie;
|
---|
86 |
|
---|
87 | typedef struct vboxsf_file_cookie
|
---|
88 | {
|
---|
89 | SHFLHANDLE handle;
|
---|
90 | PSHFLSTRING path;
|
---|
91 | } vboxsf_file_cookie;
|
---|
92 |
|
---|
93 | #ifdef __cplusplus
|
---|
94 | extern "C" {
|
---|
95 | #endif
|
---|
96 |
|
---|
97 | status_t vboxsf_new_vnode(PVBGLSFMAP map, PSHFLSTRING path, PSHFLSTRING name, vboxsf_vnode** p);
|
---|
98 | status_t vboxsf_get_vnode(fs_volume* volume, ino_t id, fs_vnode* vnode, int* _type, uint32* _flags, bool reenter);
|
---|
99 | status_t vboxsf_put_vnode(fs_volume* volume, fs_vnode* vnode, bool reenter);
|
---|
100 | PSHFLSTRING make_shflstring(const char* const s);
|
---|
101 | mode_t mode_from_fmode(RTFMODE fMode);
|
---|
102 | status_t vbox_err_to_haiku_err(int rc);
|
---|
103 | extern mutex g_vnodeCacheLock;
|
---|
104 |
|
---|
105 | #ifdef __cplusplus
|
---|
106 | }
|
---|
107 | #endif
|
---|
108 |
|
---|
109 | #endif /* ___vboxsf_h */
|
---|
110 |
|
---|