]> git.saurik.com Git - apple/hfs.git/blob - livefiles_hfs_plugin/lf_hfs_fileops_handler.h
hfs-522.100.5.tar.gz
[apple/hfs.git] / livefiles_hfs_plugin / lf_hfs_fileops_handler.h
1 /* Copyright © 2017-2018 Apple Inc. All rights reserved.
2 *
3 * lf_hfs_fileops_handler.h
4 * livefiles_hfs
5 *
6 * Created by Yakov Ben Zaken on 31/12/2017.
7 */
8
9 #ifndef lf_hfs_fileops_handler_h
10 #define lf_hfs_fileops_handler_h
11
12 #include "lf_hfs_common.h"
13
14 #define VALID_IN_ATTR_MASK ( UVFS_FA_VALID_TYPE | \
15 UVFS_FA_VALID_MODE | \
16 UVFS_FA_VALID_NLINK | \
17 UVFS_FA_VALID_UID | \
18 UVFS_FA_VALID_GID | \
19 UVFS_FA_VALID_BSD_FLAGS | \
20 UVFS_FA_VALID_SIZE | \
21 UVFS_FA_VALID_ALLOCSIZE | \
22 UVFS_FA_VALID_FILEID | \
23 UVFS_FA_VALID_PARENTID | \
24 UVFS_FA_VALID_ATIME | \
25 UVFS_FA_VALID_MTIME | \
26 UVFS_FA_VALID_CTIME | \
27 UVFS_FA_VALID_BIRTHTIME)
28
29 #define VALID_OUT_ATTR_MASK ( UVFS_FA_VALID_TYPE | \
30 UVFS_FA_VALID_MODE | \
31 UVFS_FA_VALID_NLINK | \
32 UVFS_FA_VALID_UID | \
33 UVFS_FA_VALID_GID | \
34 UVFS_FA_VALID_BSD_FLAGS | \
35 UVFS_FA_VALID_SIZE | \
36 UVFS_FA_VALID_ALLOCSIZE | \
37 UVFS_FA_VALID_FILEID | \
38 UVFS_FA_VALID_PARENTID | \
39 UVFS_FA_VALID_ATIME | \
40 UVFS_FA_VALID_MTIME | \
41 UVFS_FA_VALID_CTIME | \
42 UVFS_FA_VALID_BIRTHTIME)
43
44 #define READ_ONLY_FA_FIELDS ( UVFS_FA_VALID_TYPE | \
45 UVFS_FA_VALID_NLINK | \
46 UVFS_FA_VALID_ALLOCSIZE | \
47 UVFS_FA_VALID_FILEID | \
48 UVFS_FA_VALID_PARENTID | \
49 UVFS_FA_VALID_CTIME )
50
51 int LFHFS_Read ( UVFSFileNode psNode, uint64_t uOffset, size_t iLength, void *pvBuf, size_t *iActuallyRead );
52 int LFHFS_Write ( UVFSFileNode psNode, uint64_t uOffset, size_t iLength, const void *pvBuf, size_t *iActuallyWrite );
53 int LFHFS_Create ( UVFSFileNode psNode, const char *pcName, const UVFSFileAttributes *psAttr, UVFSFileNode *ppsOutNode );
54 int LFHFS_GetAttr ( UVFSFileNode psNode, UVFSFileAttributes *psOutAttr );
55 int LFHFS_SetAttr ( UVFSFileNode psNode, const UVFSFileAttributes *psSetAttr, UVFSFileAttributes *psOutAttr );
56 int LFHFS_Reclaim ( UVFSFileNode psNode );
57 int LFHFS_ReadLink ( UVFSFileNode psNode, void *pvOutBuf, size_t iBufSize, size_t *iActuallyRead, UVFSFileAttributes *psOutAttr );
58 int LFHFS_SymLink ( UVFSFileNode psNode, const char *pcName, const char *psContent, const UVFSFileAttributes *psAttr, UVFSFileNode *ppsOutNode );
59 int LFHFS_Rename ( UVFSFileNode psFromDirNode, UVFSFileNode psFromNode, const char *pcFromName, UVFSFileNode psToDirNode, UVFSFileNode psToNode, const char *pcToName, uint32_t flags);
60 int LFHFS_Link ( UVFSFileNode psFromNode, UVFSFileNode psToDirNode, const char *pcToName, UVFSFileAttributes* psOutFileAttrs, UVFSFileAttributes* psOutDirAttrs );
61
62 int LFHFS_GetXAttr ( UVFSFileNode psNode, const char *pcAttr, void *pvOutBuf, size_t iBufSize, size_t *iActualSize );
63 int LFHFS_SetXAttr ( UVFSFileNode psNode, const char *pcAttr, const void *pvInBuf, size_t iBufSize, UVFSXattrHow How );
64 int LFHFS_ListXAttr ( UVFSFileNode psNode, void *pvOutBuf, size_t iBufSize, size_t *iActualSize );
65
66 int LFHFS_StreamLookup ( UVFSFileNode psFileNode, UVFSStreamNode *ppsOutNode );
67 int LFHFS_StreamReclaim (UVFSStreamNode psStreamNode );
68 int LFHFS_StreamRead (UVFSStreamNode psStreamNode, uint64_t uOffset, size_t iLength, void *pvBuf, size_t *iActuallyRead );
69 #endif /* lf_hfs_fileops_handler_h */