1 /* Copyright © 2017-2018 Apple Inc. All rights reserved.
3 * lf_hfs_fileops_handler.h
6 * Created by Yakov Ben Zaken on 31/12/2017.
9 #ifndef lf_hfs_fileops_handler_h
10 #define lf_hfs_fileops_handler_h
12 #include "lf_hfs_common.h"
14 #define VALID_IN_ATTR_MASK ( UVFS_FA_VALID_TYPE | \
15 UVFS_FA_VALID_MODE | \
16 UVFS_FA_VALID_NLINK | \
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)
29 #define VALID_OUT_ATTR_MASK ( UVFS_FA_VALID_TYPE | \
30 UVFS_FA_VALID_MODE | \
31 UVFS_FA_VALID_NLINK | \
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)
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 | \
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
);
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
);
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 */