VirtualBox

Changeset 84192 in vbox for trunk/include


Ignore:
Timestamp:
May 7, 2020 8:56:01 PM (5 years ago)
Author:
vboxsync
Message:

IPRT: Adding RTZIPTAR_C_UPDATE, RTZipTarFsStreamForFile and RTZipTarFsStreamTruncate. Also added some new VFS functions and changed the fReadOnly argument of RTVfsNewFsStream into RTFILE_O_ACCESS_MASK, so it is possible to specify read+write. Untested. bugref:9699

Location:
trunk/include/iprt
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r84163 r84192  
    28082808# define RTVfsObjToFsStream                             RT_MANGLER(RTVfsObjToFsStream)
    28092809# define RTVfsObjToIoStream                             RT_MANGLER(RTVfsObjToIoStream)
     2810# define RTVfsObjToPrivate                              RT_MANGLER(RTVfsObjToPrivate)
    28102811# define RTVfsObjToSymlink                              RT_MANGLER(RTVfsObjToSymlink)
    28112812# define RTVfsObjToVfs                                  RT_MANGLER(RTVfsObjToVfs)
     
    28282829# define RTVfsSymlinkSetOwner                           RT_MANGLER(RTVfsSymlinkSetOwner)
    28292830# define RTVfsSymlinkSetTimes                           RT_MANGLER(RTVfsSymlinkSetTimes)
     2831# define RTVfsSymlinkToPrivate                          RT_MANGLER(RTVfsSymlinkToPrivate)
    28302832# define RTVfsUtilDummyPollOne                          RT_MANGLER(RTVfsUtilDummyPollOne)
    28312833# define RTVfsUtilPumpIoStreams                         RT_MANGLER(RTVfsUtilPumpIoStreams)
  • trunk/include/iprt/vfslowlevel.h

    r82968 r84192  
    311311                            PRTVFSOBJ phVfsObj, void **ppvInstance);
    312312
     313
     314/**
     315 * Gets the private data of a base object.
     316 *
     317 * @returns Pointer to the private data.  NULL if the handle is invalid in some
     318 *          way.
     319 * @param   hVfsObj             The I/O base object handle.
     320 * @param   pObjOps             The base object operations.  This servers as a
     321 *                              sort of password.
     322 */
     323RTDECL(void *) RTVfsObjToPrivate(RTVFSOBJ hVfsObj, PCRTVFSOBJOPS pObjOps);
    313324
    314325/**
     
    493504 *                              object.  The reference is consumed.  NIL and
    494505 *                              special lock handles are fine.
    495  * @param   fReadOnly           Set if read-only, clear if write-only.
     506 * @param   fAccess             RTFILE_O_READ and/or RTFILE_O_WRITE.
    496507 * @param   phVfsFss            Where to return the new handle.
    497508 * @param   ppvInstance         Where to return the pointer to the instance data
    498509 *                              (size is @a cbInstance).
    499510 */
    500 RTDECL(int) RTVfsNewFsStream(PCRTVFSFSSTREAMOPS pFsStreamOps, size_t cbInstance, RTVFS hVfs, RTVFSLOCK hLock, bool fReadOnly,
     511RTDECL(int) RTVfsNewFsStream(PCRTVFSFSSTREAMOPS pFsStreamOps, size_t cbInstance, RTVFS hVfs, RTVFSLOCK hLock, uint32_t fAccess,
    501512                             PRTVFSFSSTREAM phVfsFss, void **ppvInstance);
    502513
     
    828839                            PRTVFSSYMLINK phVfsSym, void **ppvInstance);
    829840
     841
     842/**
     843 * Gets the private data of a symbolic link.
     844 *
     845 * @returns Pointer to the private data.  NULL if the handle is invalid in some
     846 *          way.
     847 * @param   hVfsIos             The I/O stream handle.
     848 * @param   pSymlinkOps         The symlink operations.  This servers as a sort
     849 *                              of password.
     850 */
     851RTDECL(void *) RTVfsSymlinkToPrivate(RTVFSSYMLINK hVfsSym, PCRTVFSSYMLINKOPS pSymlinkOps);
    830852
    831853/**
  • trunk/include/iprt/zip.h

    r82968 r84192  
    324324 *       twice. */
    325325#define RTZIPTAR_C_SPARSE           RT_BIT_32(0)
     326/** Set if opening for updating. */
     327#define RTZIPTAR_C_UPDATE           RT_BIT_32(1)
    326328/** Valid bits. */
    327 #define RTZIPTAR_C_VALID_MASK       UINT32_C(0x00000001)
     329#define RTZIPTAR_C_VALID_MASK       UINT32_C(0x00000003)
    328330/** @} */
    329331
     
    392394RTDECL(int) RTZipTarFsStreamSetMTime(RTVFSFSSTREAM hVfsFss, PCRTTIMESPEC pModificationTime);
    393395
     396/**
     397 * Truncates a TAR creator stream in update mode.
     398 *
     399 * Use RTVfsFsStrmNext to examine the TAR stream and locate the cut-off point.
     400 *
     401 * After performing this call, the stream will be in write mode and
     402 * RTVfsFsStrmNext will stop working (VERR_WRONG_ORDER).   The RTVfsFsStrmAdd()
     403 * and RTVfsFsStrmPushFile() can be used to add new object to the TAR file,
     404 * starting at the trunction point.  RTVfsFsStrmEnd() is used to finish the TAR
     405 * file (this performs the actual file trunction).
     406 *
     407 * @returns IPRT status code.
     408 * @param   hVfsFss             The handle to a TAR creator in update mode.
     409 * @param   hVfsObj             Object returned by RTVfsFsStrmNext that the
     410 *                              trunction is relative to.  This doesn't have to
     411 *                              be the current stream object, it can be an
     412 *                              earlier one too.
     413 * @param   fAfter              If set, @a hVfsObj will remain in the update TAR
     414 *                              file.  If clear, @a hVfsObj will not be
     415 *                              included.
     416 */
     417RTDECL(int) RTZipTarFsStreamTruncate(RTVFSFSSTREAM hVfsFss, RTVFSOBJ hVfsObj, bool fAfter);
    394418
    395419/**
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette