Changeset 69977 in vbox for trunk/include/iprt
- Timestamp:
- Dec 7, 2017 1:02:36 PM (7 years ago)
- Location:
- trunk/include/iprt
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/file.h
r69105 r69977 1137 1137 /** @} */ 1138 1138 1139 /** @name RTFileSetAllocationSize flags 1139 /** 1140 * Sets the current size of the file ensuring that all required blocks 1141 * are allocated on the underlying medium. 1142 * 1143 * @returns IPRT status code. 1144 * @retval VERR_NOT_SUPPORTED if either this operation is not supported on the 1145 * current host in an efficient manner or the given combination of 1146 * flags is not supported. 1147 * @param hFile The handle to the file. 1148 * @param cbSize The new size of the file to allocate. 1149 * @param fFlags Combination of RTFILE_ALLOC_SIZE_F_* 1150 */ 1151 RTDECL(int) RTFileSetAllocationSize(RTFILE hFile, uint64_t cbSize, uint32_t fFlags); 1152 1153 /** @name RTFILE_ALLOC_SIZE_F_XXX - RTFileSetAllocationSize flags 1140 1154 * @{ */ 1141 1155 /** Default flags. */ 1142 1156 #define RTFILE_ALLOC_SIZE_F_DEFAULT 0 1143 /** Do not change the size of the file if the given size is 1144 * bigger than the current file size. Useful to preallocate 1145 * blocks beyond the current size for appending data in an efficient 1146 * manner. Might not be supported on all hosts and will return 1157 /** Do not change the size of the file if the given size is bigger than the 1158 * current file size. 1159 * 1160 * Useful to preallocate blocks beyond the current size for appending data in an 1161 * efficient manner. Might not be supported on all hosts and will return 1147 1162 * VERR_NOT_SUPPORTED in that case. */ 1148 1163 #define RTFILE_ALLOC_SIZE_F_KEEP_SIZE RT_BIT(0) … … 1151 1166 /** @} */ 1152 1167 1153 /**1154 * Sets the current size of the file ensuring that all required blocks1155 * are allocated on the underlying medium.1156 *1157 * @returns IPRT status code.1158 * @retval VERR_NOT_SUPPORTED if either this operation is not supported on the current host1159 * in an efficient manner or the given combination of flags is1160 * not supported.1161 * @param hFile The handle to the file.1162 * @param cbSize The new size of the file to allocate.1163 * @param fFlags Combination of RTFILE_ALLOC_SIZE_F_*1164 */1165 RTDECL(int) RTFileSetAllocationSize(RTFILE hFile, uint64_t cbSize, uint32_t fFlags);1166 1168 1167 1169 #ifdef IN_RING3 -
trunk/include/iprt/mangling.h
r69892 r69977 2474 2474 # define RTVfsFileGetOpenFlags RT_MANGLER(RTVfsFileGetOpenFlags) 2475 2475 # define RTVfsFileGetSize RT_MANGLER(RTVfsFileGetSize) 2476 # define RTVfsFileGetMaxSize RT_MANGLER(RTVfsFileGetMaxSize) 2476 2477 # define RTVfsFileOpen RT_MANGLER(RTVfsFileOpen) 2477 2478 # define RTVfsFileOpenNormal RT_MANGLER(RTVfsFileOpenNormal) 2478 2479 # define RTVfsFilePoll RT_MANGLER(RTVfsFilePoll) 2479 2480 # define RTVfsFileQueryInfo RT_MANGLER(RTVfsFileQueryInfo) 2481 # define RTVfsFileQueryMaxSize RT_MANGLER(RTVfsFileQueryMaxSize) 2480 2482 # define RTVfsFileRead RT_MANGLER(RTVfsFileRead) 2481 2483 # define RTVfsFileReadAt RT_MANGLER(RTVfsFileReadAt) … … 2484 2486 # define RTVfsFileRetainDebug RT_MANGLER(RTVfsFileRetainDebug) 2485 2487 # define RTVfsFileSeek RT_MANGLER(RTVfsFileSeek) 2488 # define RTVfsFileSetSize RT_MANGLER(RTVfsFileSetSize) 2486 2489 # define RTVfsFileSgRead RT_MANGLER(RTVfsFileSgRead) 2487 2490 # define RTVfsFileSgWrite RT_MANGLER(RTVfsFileSgWrite) -
trunk/include/iprt/vfs.h
r69844 r69977 1404 1404 RTDECL(int) RTVfsFileSeek(RTVFSFILE hVfsFile, RTFOFF offSeek, uint32_t uMethod, uint64_t *poffActual); 1405 1405 1406 RTDECL(int) RTVfsFileSetSize(RTVFSFILE hVfsFile, uint64_t cbSize); 1406 /** 1407 * Sets the size of a file. 1408 * 1409 * This may also be used for preallocating space 1410 * (RTVFSFILE_SIZE_F_PREALLOC_KEEP_SIZE). 1411 * 1412 * @returns IPRT status code. 1413 * @retval VERR_ACCESS_DENIED if handle isn't writable. 1414 * @retval VERR_WRITE_PROTECT if read-only file system. 1415 * @retval VERR_FILE_TOO_BIG if cbSize is larger than what the file system can 1416 * theoretically deal with. 1417 * @retval VERR_DISK_FULL if the file system if full. 1418 * @retval VERR_NOT_SUPPORTED if fFlags indicates some operation that's not 1419 * supported by the file system / host operating system. 1420 * 1421 * @param hVfsFile The VFS file handle. 1422 * @param cbSize The new file size. 1423 * @param fFlags RTVFSFILE_SIZE_F_NORMAL, RTVFSFILE_SIZE_F_GROW, or 1424 * RTVFSFILE_SIZE_F_GROW_KEEP_SIZE. 1425 * 1426 * @sa RTFileSetSize, RTFileSetAllocationSize 1427 */ 1428 RTDECL(int) RTVfsFileSetSize(RTVFSFILE hVfsFile, uint64_t cbSize, uint32_t fFlags); 1429 1430 /** @name RTVFSFILE_SIZE_F_XXX - RTVfsFileSetSize flags. 1431 * @{ */ 1432 /** Normal truncate or grow (zero'ed) like RTFileSetSize . */ 1433 #define RTVFSFILE_SIZE_F_NORMAL UINT32_C(0x00000001) 1434 /** Only grow the file, ignore call if cbSize would trunacte the file. 1435 * This is what RTFileSetAllocationSize does by default. */ 1436 #define RTVFSFILE_SIZE_F_GROW UINT32_C(0x00000002) 1437 /** Only grow the file, ignore call if cbSize would trunacte the file. 1438 * This is what RTFileSetAllocationSize does by default. */ 1439 #define RTVFSFILE_SIZE_F_GROW_KEEP_SIZE UINT32_C(0x00000003) 1440 /** Action mask. */ 1441 #define RTVFSFILE_SIZE_F_ACTION_MASK UINT32_C(0x00000003) 1442 /** Validate the flags. 1443 * Will reference @a a_fFlags more than once. */ 1444 #define RTVFSFILE_SIZE_F_IS_VALID(a_fFlags) \ 1445 ( !((a_fFlags) & ~RTVFSFILE_SIZE_F_ACTION_MASK) && ((a_fFlags) & RTVFSFILE_SIZE_F_ACTION_MASK) != 0 ) 1446 /** @} */ 1447 1448 1449 /** Mask of valid flags. */ 1450 #define RTFILE_ALLOC_SIZE_F_VALID (RTFILE_ALLOC_SIZE_F_KEEP_SIZE) 1451 /** @} */ 1452 1453 1407 1454 RTDECL(int) RTVfsFileGetSize(RTVFSFILE hVfsFile, uint64_t *pcbSize); 1408 1455 RTDECL(RTFOFF) RTVfsFileGetMaxSize(RTVFSFILE hVfsFile); 1409 RTDECL(int) RTVfsFile GetMaxSizeEx(RTVFSFILE hVfsFile, PRTFOFFpcbMax);1456 RTDECL(int) RTVfsFileQueryMaxSize(RTVFSFILE hVfsFile, uint64_t *pcbMax); 1410 1457 1411 1458 /** -
trunk/include/iprt/vfslowlevel.h
r69955 r69977 1004 1004 1005 1005 /** 1006 * Get the current file /streamsize.1006 * Get the current file size. 1007 1007 * 1008 1008 * @returns IPRT status code. … … 1012 1012 */ 1013 1013 DECLCALLBACKMEMBER(int, pfnQuerySize)(void *pvThis, uint64_t *pcbFile); 1014 1015 /** 1016 * Change the file size. 1017 * 1018 * @returns IPRT status code. 1019 * @retval VERR_ACCESS_DENIED if handle isn't writable. 1020 * @retval VERR_WRITE_PROTECT if read-only file system. 1021 * @retval VERR_FILE_TOO_BIG if cbSize is larger than what the file system can 1022 * theoretically deal with. 1023 * @retval VERR_DISK_FULL if the file system if full. 1024 * @retval VERR_NOT_SUPPORTED if fFlags indicates some operation that's not 1025 * supported by the file system / host operating system. 1026 * 1027 * @param pvThis The implementation specific file data. 1028 * @param pcbFile Where to store the current file size. 1029 * @param fFlags RTVFSFILE_SET_SIZE_F_XXX. 1030 * @note Optional. If NULL, VERR_WRITE_PROTECT will be returned. 1031 * @sa RTFileSetSize, RTFileSetAllocationSize 1032 */ 1033 DECLCALLBACKMEMBER(int, pfnSetSize)(void *pvThis, uint64_t cbFile, uint32_t fFlags); 1034 1035 /** 1036 * Determine the maximum file size. 1037 * 1038 * This won't take amount of freespace into account, just the limitations of the 1039 * underlying file system / host operating system. 1040 * 1041 * @returns IPRT status code. 1042 * @param pvThis The implementation specific file data. 1043 * @param pcbMax Where to return the max file size. 1044 * @note Optional. If NULL, VERR_NOT_IMPLEMENTED will be returned. 1045 * @sa RTFileGetMaxSizeEx 1046 */ 1047 DECLCALLBACKMEMBER(int, pfnQueryMaxSize)(void *pvThis, uint64_t *pcbMax); 1014 1048 1015 1049 /** @todo There will be more methods here. */ … … 1022 1056 1023 1057 /** The RTVFSFILEOPS structure version. */ 1024 #define RTVFSFILEOPS_VERSION RT_MAKE_U32_FROM_U8(0xff,0x7f, 1,0)1058 #define RTVFSFILEOPS_VERSION RT_MAKE_U32_FROM_U8(0xff,0x7f,2,0) 1025 1059 1026 1060 /**
Note:
See TracChangeset
for help on using the changeset viewer.