VirtualBox

Changeset 86035 in vbox


Ignore:
Timestamp:
Sep 6, 2020 8:31:16 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
140245
Message:

Runtime/cpiovfs.cpp: A simple CPIO archive reader (WIP, writer comes next and then some cleanup)

Location:
trunk
Files:
3 added
4 edited

Legend:

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

    r85949 r86035  
    29202920# define RTZipXarFsStreamFromIoStream                   RT_MANGLER(RTZipXarFsStreamFromIoStream)
    29212921# define RTZipTarFsStreamForFile                        RT_MANGLER(RTZipTarFsStreamForFile)
     2922# define RTZipCpioFsStreamFromIoStream                  RT_MANGLER(RTZipCpioFsStreamFromIoStream)
    29222923
    29232924/* sort/merge into the above later: */
  • trunk/include/iprt/zip.h

    r85121 r86035  
    501501RTDECL(int) RTZipXarFsStreamFromIoStream(RTVFSIOSTREAM hVfsIosIn, uint32_t fFlags, PRTVFSFSSTREAM phVfsFss);
    502502
     503/**
     504 * Opens a CPIO filesystem stream.
     505 *
     506 * This is used to extract, list or check a CPIO archive.
     507 *
     508 * @returns IPRT status code.
     509 *
     510 * @param   hVfsIosIn           The input stream.  The reference is not
     511 *                              consumed, instead another one is retained.
     512 * @param   fFlags              Flags, MBZ.
     513 * @param   phVfsFss            Where to return the handle to the CPIO
     514 *                              filesystem stream.
     515 */
     516RTDECL(int) RTZipCpioFsStreamFromIoStream(RTVFSIOSTREAM hVfsIosIn, uint32_t fFlags, PRTVFSFSSTREAM phVfsFss);
     517
    503518/** @} */
    504519
  • trunk/src/VBox/Runtime/Makefile.kmk

    r85875 r86035  
    682682        common/vfs/vfsstdpipe.cpp \
    683683        common/vfs/vfsprintf.cpp \
     684        common/zip/cpiovfs.cpp \
    684685        common/zip/tar.cpp \
    685686        common/zip/tarcmd.cpp \
  • trunk/src/VBox/Runtime/common/zip/tarcmd.cpp

    r84761 r86035  
    7575    RTZIPTARCMDFORMAT_TAR,
    7676    /** XAR.  */
    77     RTZIPTARCMDFORMAT_XAR
     77    RTZIPTARCMDFORMAT_XAR,
     78    /** CPIO. */
     79    RTZIPTARCMDFORMAT_CPIO,
    7880} RTZIPTARCMDFORMAT;
    7981
     
    818820        rc = VERR_NOT_SUPPORTED;
    819821#endif
     822    else if (pOpts->enmFormat == RTZIPTARCMDFORMAT_CPIO)
     823        rc = RTZipCpioFsStreamFromIoStream(hVfsIos, 0/*fFlags*/, phVfsFss);
    820824    else /** @todo make RTZipTarFsStreamFromIoStream fail if not tar file! */
    821825        rc = RTZipTarFsStreamFromIoStream(hVfsIos, 0/*fFlags*/, phVfsFss);
     
    16061610             "                  pax (tar POSIX.1-2001),\n"
    16071611             "                  xar\n"
    1608              "        Note! Because XAR/TAR detection isn't implemented yet, it\n"
     1612             "                  cpio\n"
     1613             "        Note! Because XAR/TAR/CPIO detection isn't implemented yet, it\n"
    16091614             "              is necessary to specifcy --format=xar when reading a\n"
    1610              "              XAR file.  Otherwise this option is only for creation.\n"
     1615             "              XAR file or --format=cpio for a CPIO file.\n"
     1616             "              Otherwise this option is only for creation.\n"
    16111617             "\n");
    16121618    RTPrintf("IPRT Options:\n"
     
    18611867                else if (!strcmp(ValueUnion.psz, "xar"))
    18621868                    Opts.enmFormat    = RTZIPTARCMDFORMAT_XAR;
     1869                else if (!strcmp(ValueUnion.psz, "cpio"))
     1870                    Opts.enmFormat    = RTZIPTARCMDFORMAT_CPIO;
    18631871                else
    18641872                    return RTMsgErrorExit(RTEXITCODE_SYNTAX, "Unknown archive format: '%s'", ValueUnion.psz);
Note: See TracChangeset for help on using the changeset viewer.

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